diff options
Diffstat (limited to 'fdio.infra.terraform/terraform-aws-vpc')
-rw-r--r-- | fdio.infra.terraform/terraform-aws-vpc/main.tf | 12 | ||||
-rw-r--r-- | fdio.infra.terraform/terraform-aws-vpc/outputs.tf | 21 | ||||
-rw-r--r-- | fdio.infra.terraform/terraform-aws-vpc/variables.tf | 9 | ||||
-rw-r--r-- | fdio.infra.terraform/terraform-aws-vpc/versions.tf | 2 |
4 files changed, 35 insertions, 9 deletions
diff --git a/fdio.infra.terraform/terraform-aws-vpc/main.tf b/fdio.infra.terraform/terraform-aws-vpc/main.tf index 59ac63663d..fb51a7b385 100644 --- a/fdio.infra.terraform/terraform-aws-vpc/main.tf +++ b/fdio.infra.terraform/terraform-aws-vpc/main.tf @@ -32,6 +32,7 @@ resource "aws_security_group" "security_group" { 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 +40,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) } } } diff --git a/fdio.infra.terraform/terraform-aws-vpc/outputs.tf b/fdio.infra.terraform/terraform-aws-vpc/outputs.tf index e1072a6b16..b58963917b 100644 --- a/fdio.infra.terraform/terraform-aws-vpc/outputs.tf +++ b/fdio.infra.terraform/terraform-aws-vpc/outputs.tf @@ -1,9 +1,24 @@ output "vpc_id" { value = aws_vpc.vpc.id - description = "The ID of the VPC" + description = "The ID of the VPC." } output "vpc_ipv6_cidr_block" { value = aws_vpc.vpc.ipv6_cidr_block - description = "IPv6 CIDR block" -}
\ No newline at end of file + description = "IPv6 CIDR block." +} + +output "vpc_main_route_table_id" { + value = aws_vpc.vpc.main_route_table_id + description = "The ID of the Main Route Table." +} + +output "vpc_subnet_id" { + value = aws_subnet.subnet.id + description = "The ID of the Subnet." +} + +output "vpc_security_group_id" { + value = aws_security_group.security_group.id + description = "The ID of the Security Group." +} diff --git a/fdio.infra.terraform/terraform-aws-vpc/variables.tf b/fdio.infra.terraform/terraform-aws-vpc/variables.tf index 1e883eda78..5c7c8dc79a 100644 --- a/fdio.infra.terraform/terraform-aws-vpc/variables.tf +++ b/fdio.infra.terraform/terraform-aws-vpc/variables.tf @@ -67,6 +67,15 @@ variable "security_group_ingress" { from_port = 22 to_port = 22 protocol = "tcp" + self = false + cidr_blocks = ["0.0.0.0/0"] + ipv6_cidr_blocks = ["::/0"] + }, + { + from_port = 0 + to_port = 0 + protocol = -1 + self = true cidr_blocks = ["0.0.0.0/0"] ipv6_cidr_blocks = ["::/0"] }, diff --git a/fdio.infra.terraform/terraform-aws-vpc/versions.tf b/fdio.infra.terraform/terraform-aws-vpc/versions.tf index 66b9c17f9b..eed543f20a 100644 --- a/fdio.infra.terraform/terraform-aws-vpc/versions.tf +++ b/fdio.infra.terraform/terraform-aws-vpc/versions.tf @@ -5,5 +5,5 @@ terraform { version = "~> 4.3.0" } } - required_version = ">= 1.1.4" + required_version = ">= 1.0.4" } |