hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.73k stars 9.09k forks source link

Expose resource ARN for AWS API Gateway Stage #9071

Closed chendilv closed 4 years ago

chendilv commented 5 years ago

Current Terraform Version

Terraform v0.12.2

Use-cases

A WAF WebACL can be associated with an API Gateway Stage. This is supported by terraform already : https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl_association.html However, terraform does not provide a way to access the resource arn for a API Gateway Stage : https://www.terraform.io/docs/providers/aws/r/api_gateway_stage.html

(The execution Arn is something different - the API Gateway Stage Arn will have the format arn:aws:apigateway:{region}::/restapis/{api_id}/stages/{stage_name})

So there is no (clean) way to provide a API Gateway stage resource arn to a WebACL association.

Attempted Solutions

Proposal

Add an attribute called 'arn' to aws_api_gateway_stage that exposes the resource arn of the API Gateway stage.

References

Closest related GitHub issue : https://github.com/terraform-providers/terraform-provider-aws/issues/6441

Related Terraform docs : https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl_association.html https://www.terraform.io/docs/providers/aws/r/api_gateway_stage.html

CumpsD commented 4 years ago

This would make it a lot easier indeed. I just stumbled on this in trying to figure out how to build the stage arn for WAF

idledk commented 4 years ago

We really need this. It makes much easier when applying a WAF to an API gateway, not having to generate the ARN for the API

bflad commented 4 years ago

The arn attribute will be added as part of #10570

bflad commented 4 years ago

Support for the arn attribute has been merged and will release with version 2.36.0 of the Terraform AWS Provider, Thursday next week. Thanks to @DrFaust92 for the implementation. 👍

ghost commented 4 years ago

This has been released in version 2.36.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 commented 4 years ago

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!