Skip to content

Insufficient ip_address blocks for aws_route53_resolver_endpoint #22195

@christianmeyer

Description

@christianmeyer

Terraform Version

Terraform v0.12.5

Terraform Configuration Files

resource "aws_route53_resolver_endpoint" "inbound" {
  name      = "${local.name_prefix}inbound-endpoint"
  direction = "INBOUND"

  security_group_ids = [
    aws_security_group.inbound.id,
  ]

  dynamic "ip_address" {
    for_each = aws_subnet.this.*.id
    iterator = subnet_id
    content {
      subnet_id = subnet_id.value
    }
  }

  tags      = var.tags
}

Expected Behavior

Pass validation and then create two ip_address blocks during planning.

Actual Behavior

Error: Insufficient ip_address blocks

  on  line 0:
  (source code not available)

At least 2 "ip_address" blocks are required.

It's failing the validation.

Steps to Reproduce

Run terraform validate with two or more elements in aws_subnet.this.*.id.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions