Closed
Description
Attempting to run terraform apply
with the example gives the following error
│ Error: Invalid count argument
│
│ on vpc_setup/vpc.tf line 92, in resource "aws_route_table_association" "main_subnets_public":
│ 92: count = length(data.aws_subnet_ids.main_public.ids)
│
│ 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.
╵
╷
│ Error: Invalid count argument
│
│ on vpc_setup/vpc.tf line 101, in resource "aws_route_table_association" "main_subnets_private":
│ 101: count = length(data.aws_subnet_ids.main_private.ids)
│
│ 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.```