Skip to content

Creating resource aws_wafv2_web_acl_association in same config as aws_wafv2_web_acl often raises WAFUnavailableEntityException #17527

@Carlovo

Description

@Carlovo

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.2
aws 3.8.0
I didn't see any relevant changes between then and the current version, though.

Affected Resource(s)

  • aws_wafv2_web_acl_association

Terraform Configuration Files

resource "aws_wafv2_web_acl_association" "example" {
  resource_arn = aws_lb.example.arn
  web_acl_arn  = aws_wafv2_web_acl.example.arn
}

resource "aws_wafv2_web_acl" "example" {
  name  = "alb-example"
  scope = "REGIONAL"

  # some more irrelevant config goes here
}

resource "aws_lb" "example" {
  name = "example"
  
  # some more irrelevant config goes here
}

Expected Behavior

Deploy a Load Balancer with a WAF ACL in front of it.

Actual Behavior

Almost half of the time (I tried around 10 times) Terraform errors with WAFUnavailableEntityException. This is already a RetryError in the TF AWS provider code, but presumably the time between ACL creation and load balancer association is still not long enough to get this reproducibly correct.

Steps to Reproduce

See Actual behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    service/elbv2Issues and PRs that pertain to the elbv2 service.service/wafv2Issues and PRs that pertain to the wafv2 service.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions