File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,11 @@ module "vpc" {
2828 local.network_acls["elasticache_outbound"],
2929 )
3030
31- private_dedicated_network_acl = true
31+ private_dedicated_network_acl = false
3232 elasticache_dedicated_network_acl = true
3333
34+ manage_default_network_acl = true
35+
3436 enable_ipv6 = true
3537
3638 enable_nat_gateway = false
@@ -200,4 +202,3 @@ locals {
200202 ]
201203 }
202204}
203-
Original file line number Diff line number Diff line change @@ -534,6 +534,27 @@ resource "aws_default_network_acl" "this" {
534534
535535 default_network_acl_id = element(concat(aws_vpc.this.*.default_network_acl_id, [""]), 0)
536536
537+ # The value of subnet_ids should be any subnet IDs that are not set as subnet_ids
538+ # for any of the non-default network ACLs
539+ subnet_ids = setsubtract(
540+ compact(flatten([
541+ aws_subnet.public.*.id,
542+ aws_subnet.private.*.id,
543+ aws_subnet.intra.*.id,
544+ aws_subnet.database.*.id,
545+ aws_subnet.redshift.*.id,
546+ aws_subnet.elasticache.*.id,
547+ ])),
548+ compact(flatten([
549+ aws_network_acl.public.*.subnet_ids,
550+ aws_network_acl.private.*.subnet_ids,
551+ aws_network_acl.intra.*.subnet_ids,
552+ aws_network_acl.database.*.subnet_ids,
553+ aws_network_acl.redshift.*.subnet_ids,
554+ aws_network_acl.elasticache.*.subnet_ids,
555+ ]))
556+ )
557+
537558 dynamic "ingress" {
538559 for_each = var.default_network_acl_ingress
539560 content {
You can’t perform that action at this time.
0 commit comments