Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack module dependency issues #244

Open
samkahchiin opened this issue Aug 17, 2023 · 0 comments
Open

Stack module dependency issues #244

samkahchiin opened this issue Aug 17, 2023 · 0 comments

Comments

@samkahchiin
Copy link
Contributor

samkahchiin commented Aug 17, 2023

Error when setting cloudwatch_dashboard_view = "detailed"

│ Error: Invalid count argument
│ 
│   on .terraform/modules/stack/cloudwatch/alarm.tf line 226, in resource "aws_cloudwatch_metric_alarm" "error_rate":
│  226:   count               = length(var.alb_arn_suffixes)
│ 
│ 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 .terraform/modules/stack/cloudwatch/alarm.tf line 379, in resource "aws_cloudwatch_metric_alarm" "extreme_slow_request":
│  379:   count               = length(var.alb_arn_suffixes)
│ 
│ 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.
╵

Common error even setting public_ips to empty array

│ Error: Invalid for_each argument
│ 
│   on .terraform/modules/stack/nat/nat.tf line 44, in resource "aws_route_table_association" "main":
│   44:   for_each  = { for idx, subnet in var.subnet_private_ids : subnet => idx }
│     ├────────────────
│     │ var.subnet_private_ids is tuple with 3 elements
│ 
│ The "for_each" map includes keys derived from resource attributes that cannot be determined until apply, and so Terraform cannot determine the full set of keys that will identify the instances of this resource.
│ 
│ When working with unknown values in for_each, it's better to define the map keys statically in your configuration and place apply-time results only in the map values.
│ 
│ Alternatively, you could use the -target planning option to first apply only the resources that the for_each value depends on, and then apply a second time to fully converge.
╵

In stack/setup

│ Error: Invalid count argument
│ 
│   on .terraform/modules/stack-setup/secrets/secrets.tf line 6, in module "kms-key":
│    6:   count = var.kms_key_id == null ? 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant