You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
╷
│ Error: Invalid for_each argument
│
│ on ecr/modules/ecr/main.tf line 310, in resource "aws_ecr_repository_policy" "name":
│ 310: for_each = toset(local.ecr_need_policy && module.this.enabled ? local.image_names : [])
│ ├────────────────
│ │ local.ecr_need_policy is a bool, known only after apply
│ │ local.image_names is list of string with 2 elements
│ │ module.this.enabled is true
│
│ The "for_each" set includes values 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 use a map value where the keys are defined statically in your configuration and where only the values contain apply-time results.
│
│ 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.
╵
Expected Behavior
no issues
Steps to Reproduce
fresh deployment using ecr, using
module "ecr" {
source = "cloudposse/ecr/aws"
version = "0.40.0"
}
Screenshots
No response
Environment
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Describe the Bug
Expected Behavior
no issues
Steps to Reproduce
fresh deployment using ecr, using
Screenshots
No response
Environment
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: