Terraform version 0.11.8
AWS Provider version: 1.43.2
I haven't got a simple example that I can share currently, however the aws_wafregional_web_acl_association was originally designed for attaching a regional WAF to an application load balancer. The resource works for an API Gateway, however on refresh it fails to detect that the WAF is associated with the API gateway and re-associates it.
This appears to be because the aws API check for ListResourcesForWebACL only returns application load balancer results by default, and would require an additional call (passing resource type = API_GATEWAY ) to check for the API Gateway association.
With no changes, a terraform plan should return nothing to do.
Wants to perform the association on every plan/apply:
terraform apply
Testing the ListResourcesForWebACL call:
$ aws waf-regional list-resources-for-web-acl --web-acl-id "ebe3ecfd-e4a0-4ec3-ae85-a6c21146c232"
{
"ResourceArns": []
}
$ aws waf-regional list-resources-for-web-acl --web-acl-id "ebe3ecfd-e4a0-4ec3-ae85-a6c21146c232" --resource-type APPLICATION_LOAD_BALANCER
{
"ResourceArns": []
}
$ aws waf-regional list-resources-for-web-acl --web-acl-id "ebe3ecfd-e4a0-4ec3-ae85-a6c21146c232" --resource-type API_GATEWAY
{
"ResourceArns": [
"arn:aws:apigateway:ap-southeast-2::/restapis/abqmyzzv6d/stages/dev"
]
}
It doesn't actually specify that the ListResourcesForWebACL call only returns APPLICATION_LOAD_BALANCER results when no resource type is specified, but my testing appears to demonstrate that this is the case.
AWS ListResourcesForWebACL Documentation
(Note on issue labelling: we don't currently list API Gateway support in the resource documentation, so its an enhancement)
@bflad Apologies for poking you directly, but there's an open PR that appears to resolve this problem, but it isn't getting any attention. Can you assist with getting this reviewed ?
Support for additional resource ARN types (e.g. API Gateway) has been merged and will release with version 2.6.0 of the Terraform AWS Provider later today. 👍
This has been released in version 2.6.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
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!
Most helpful comment
@bflad Apologies for poking you directly, but there's an open PR that appears to resolve this problem, but it isn't getting any attention. Can you assist with getting this reviewed ?