Skip to content

Cannot be determined for_each in rules variable of alb-listener module #53

@posquit0

Description

@posquit0
 > tf apply
╷
│ Error: Invalid for_each argument
│
│   on ../../modules/alb-listener/main.tf line 148, in resource "aws_lb_listener_rule" "this":
│  148:   for_each = {
│  149:     for rule in var.rules :
│  150:     rule.priority => rule
│  151:   }
│     ├────────────────
│     │ var.rules will be known only after apply
│
│ The "for_each" 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 for_each depends on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions