terraform-aws-named-subnets icon indicating copy to clipboard operation
terraform-aws-named-subnets copied to clipboard

Cannot pass default acl ID from vpc module

Open ekristen opened this issue 3 years ago • 1 comments

Found a bug? Maybe our Slack Community can help.

Slack Community

Describe the Bug

Even though the variable private_network_acl_id exists, if you pass it from the vpc module you get a count error

Error: Invalid count argument

  on .terraform/modules/dev_subnets/private.tf line 56, in resource "aws_network_acl" "private":
  56:   count      = module.this.enabled && var.type == "private" && signum(length(var.private_network_acl_id)) == 0 ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.

Expected Behavior

I would expect to be able to pass the acl reference down. Perhaps this is a limitation in terraform?

ekristen avatar Jul 14 '21 16:07 ekristen