Last active
January 3, 2022 13:09
-
-
Save ian-hancock/52aa885b106d651e541ce01a7856ca38 to your computer and use it in GitHub Desktop.
VPC Excerpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_default_security_group" "this" { | |
count = var.create_vpc && var.manage_default_security_group ? 1 : 0 | |
vpc_id = aws_vpc.this[0].id | |
dynamic "ingress" { | |
for_each = var.default_security_group_ingress | |
content { | |
self = lookup(ingress.value, "self", null) | |
cidr_blocks = compact(split(",", lookup(ingress.value, "cidr_blocks", ""))) | |
ipv6_cidr_blocks = compact(split(",", lookup(ingress.value, "ipv6_cidr_blocks", ""))) | |
prefix_list_ids = compact(split(",", lookup(ingress.value, "prefix_list_ids", ""))) | |
security_groups = compact(split(",", lookup(ingress.value, "security_groups", ""))) | |
description = lookup(ingress.value, "description", null) | |
from_port = lookup(ingress.value, "from_port", 0) | |
to_port = lookup(ingress.value, "to_port", 0) | |
protocol = lookup(ingress.value, "protocol", "-1") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment