diff --git a/README.md b/README.md index 7569a1e8a..77102f95f 100644 --- a/README.md +++ b/README.md @@ -315,8 +315,8 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | default\_network\_acl\_name | Name to be used on the Default Network ACL | `string` | `""` | no | | default\_network\_acl\_tags | Additional tags for the Default Network ACL | `map(string)` | `{}` | no | | default\_security\_group\_egress | List of maps of egress rules to set on the default security group | `list(map(string))` |
[| no | -| default\_security\_group\_ingress | List of maps of ingress rules to set on the default security group | `list(map(string))` |
{
"cidr_blocks": "0.0.0.0/0",
"from_port": 0,
"protocol": "-1",
"to_port": 0
}
]
[| no | -| default\_security\_group\_name | Name to be used on the default security group | `string` | `""` | no | +| default\_security\_group\_ingress | List of maps of ingress rules to set on the default security group | `list(map(string))` | `null` | no | +| default\_security\_group\_name | Name to be used on the default security group | `string` | `"default"` | no | | default\_security\_group\_tags | Additional tags for the default security group | `map(string)` | `{}` | no | | default\_vpc\_enable\_classiclink | Should be true to enable ClassicLink in the Default VPC | `bool` | `false` | no | | default\_vpc\_enable\_dns\_hostnames | Should be true to enable DNS hostnames in the Default VPC | `bool` | `false` | no | diff --git a/main.tf b/main.tf index 9b78e4722..844d9c7fa 100644 --- a/main.tf +++ b/main.tf @@ -57,7 +57,7 @@ resource "aws_vpc_ipv4_cidr_block_association" "this" { resource "aws_default_security_group" "this" { count = var.create_vpc && var.manage_default_security_group ? 1 : 0 - vpc_id = element(concat(aws_vpc.this.*.id, [""]), 0) + vpc_id = aws_vpc.this[0].id dynamic "ingress" { for_each = var.default_security_group_ingress diff --git a/variables.tf b/variables.tf index bcdaea069..4f0c5e58d 100644 --- a/variables.tf +++ b/variables.tf @@ -2268,21 +2268,13 @@ variable "manage_default_security_group" { variable "default_security_group_name" { description = "Name to be used on the default security group" type = string - default = "" + default = "default" } variable "default_security_group_ingress" { description = "List of maps of ingress rules to set on the default security group" type = list(map(string)) - - default = [ - { - self = true - from_port = 0 - to_port = 0 - protocol = "-1" - } - ] + default = null } variable "enable_flow_log" {
{
"from_port": 0,
"protocol": "-1",
"self": true,
"to_port": 0
}
]