fix(terraform): AWS alignments
[csit.git] / fdio.infra.terraform / terraform-aws-vpc / main.tf
index 59ac636..1b84f8e 100644 (file)
@@ -26,12 +26,21 @@ resource "aws_security_group" "security_group" {
   tags                   = local.tags
   vpc_id                 = aws_vpc.vpc.id
 
+  ingress {
+    from_port        = 0
+    to_port          = 0
+    protocol         = -1
+    self             = true
+    ipv6_cidr_blocks = ["::/0"]
+  }
+
   dynamic "ingress" {
     for_each = var.security_group_ingress
     content {
       from_port        = lookup(ingress.value, "from_port", null)
       to_port          = lookup(ingress.value, "to_port", null)
       protocol         = lookup(ingress.value, "protocol", null)
+      self             = lookup(ingress.value, "self", null)
       cidr_blocks      = lookup(ingress.value, "cidr_blocks", null)
       ipv6_cidr_blocks = lookup(ingress.value, "ipv6_cidr_blocks", null)
     }
@@ -39,11 +48,12 @@ resource "aws_security_group" "security_group" {
   dynamic "egress" {
     for_each = var.security_group_egress
     content {
-      from_port        = lookup(ingress.value, "from_port", null)
-      to_port          = lookup(ingress.value, "to_port", null)
-      protocol         = lookup(ingress.value, "protocol", null)
-      cidr_blocks      = lookup(ingress.value, "cidr_blocks", null)
-      ipv6_cidr_blocks = lookup(ingress.value, "ipv6_cidr_blocks", null)
+      from_port        = lookup(egress.value, "from_port", null)
+      to_port          = lookup(egress.value, "to_port", null)
+      protocol         = lookup(egress.value, "protocol", null)
+      self             = lookup(egress.value, "self", null)
+      cidr_blocks      = lookup(egress.value, "cidr_blocks", null)
+      ipv6_cidr_blocks = lookup(egress.value, "ipv6_cidr_blocks", null)
     }
   }
 }