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

error getting WAF Regional Web ACL for resource (<api gw stage arn>): empty response #9203

Closed
andreafalzetti opened this issue Jul 2, 2019 · 6 comments · Fixed by #10216
Closed
Labels
bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service.
Milestone

Comments

@andreafalzetti
Copy link

andreafalzetti commented Jul 2, 2019

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 "me too" comments, 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 Version

  • Terraform Version: 0.11.11
  • provider "aws" 2.17.0

Affected Resource(s)

  • aws_wafregional_web_acl_association

Terraform Configuration Files

resource "aws_wafregional_web_acl_association" "restrict" {
  resource_arn = "arn:aws:apigateway:${var.region}::/restapis/${aws_api_gateway_rest_api.api.id}/stages/${var.env}"
  web_acl_id   = "${aws_wafregional_web_acl.restrict.id}"
}

Expected Behavior

Terraform apply should attach a regional WAF ACL to an API GW stage.

Actual Behavior

Terraform apply fails because it cannot find the resource (empty response).

Error: Error refreshing state: 1 error(s) occurred:

* aws_wafregional_web_acl_association.restrict: 1 error(s) occurred:

* aws_wafregional_web_acl_association.restrict: aws_wafregional_web_acl_association.restrict: error getting WAF Regional Web ACL for resource (<stage id>): empty response

Steps to Reproduce

  1. Create an API Gateway
  2. Create a regional WAF ACL
  3. Attach the regional WAF ACL to the API Gateway stage
  4. Terraform init
  5. Terraform plan
  6. Terraform apply -> Fails

References

Using the AWS cli, this operation is possible:

aws waf-regional associate-web-acl \                                                                                                                                                                                 
  --web-acl-id '<acl id> \
  --resource-arn '<stage id>'
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 2, 2019
@aeschright aeschright added the service/waf Issues and PRs that pertain to the waf service. label Jul 3, 2019
@eestolano
Copy link

I just saw this error in a different scenario. I had a web ACL association with an ALB. Manually removing the association outside of Terraform caused terraform plan to fail in the refresh phase with:

error getting WAF Regional Web ACL for resource (<ALB ARN>): empty response

Manually recreating the association fixed the error.

@ChildOfTheCron
Copy link

ChildOfTheCron commented Aug 12, 2019

Ran into a similar issue as above on terraform 0.12.5 with aws provider 2.23.0:

error getting WAF Regional Web ACL for resource (<ALB ARN>): empty response

After deleting all WAF resources in my test environment and running terraform plan to recreate. Tried terraform reset to update state, but this did not help. As mentioned above, had to manually recreate WAF ACL and associate ALBs before re-running terraform plan.

@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 24, 2019
bflad added a commit that referenced this issue Sep 24, 2019
… triggers state removal

Reference: #9203

Previous to code change:

```
--- FAIL: TestAccAWSWafRegionalWebAclAssociation_disappears (175.64s)
    testing.go:569: Step 0 error: errors during follow-up refresh:

        Error: error getting WAF Regional Web ACL for resource (arn:aws:elasticloadbalancing:us-west-2:--OMITTED--:loadbalancer/app/tf-lb-20190924095723723200000001/e2739f0d448dc712): empty response
```

Output from acceptance testing:

```
--- PASS: TestAccAWSWafRegionalWebAclAssociation_disappears (207.92s)
```
@bflad
Copy link
Contributor

bflad commented Sep 24, 2019

Hi folks 👋 Thanks for the report and sorry for the trouble. Fix submitted here: #10216

@bflad bflad added this to the v2.31.0 milestone Sep 30, 2019
@bflad
Copy link
Contributor

bflad commented Sep 30, 2019

The fix for this has been merged and will release with version 2.31.0 of the Terraform AWS Provider, later this week. 👍

@ghost
Copy link

ghost commented Oct 3, 2019

This has been released in version 2.31.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 1, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/waf Issues and PRs that pertain to the waf service.
Projects
None yet
5 participants