-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
aws_api_gateway_rest_api: Add execute_arn computed attribute #3968
Conversation
…ution_arn` attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mewa 👋 Thanks for this contribution. Can you please see the below and let me know if you have any questions?
restApiId := d.Id() | ||
region := meta.(*AWSClient).region | ||
accountId := meta.(*AWSClient).accountid | ||
arn, err := buildApiGatewayExecutionARN(restApiId, region, accountId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function no longer exists as we have moved to prefer using the SDK arn
package. Can you please build the ARN like the following (modifying as appropriate):
executionArn := arn.ARN{
Partition: meta.(*AWSClient).partition,
Service: "execute-api",
Region: meta.(*AWSClient).region,
AccountID: meta.(*AWSClient).accountid,
Resource: d.Id(),
}.String()
d.Set("execution_arn", executionArn)
```hcl | ||
resource "aws_api_gateway_rest_api" "MyDemoAPI" { | ||
name = "MyDemoAPI" | ||
description = "This is my API for demonstration purposes" | ||
} | ||
``` | ||
|
||
### Using REST API execution_arn to specify Lambda permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move this example to the aws_lambda_permission
resource documentation instead?
…tribute to `aws_lambda_permission` docs
Hi @bflad, thank you for your response (and sorry for replying late). I have applied your suggestions and merged changes from master, so hopefully the PR should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @mewa, looks great! 🚀
3 tests passed (all tests)
=== RUN TestAccAWSAPIGatewayRestApi_openapi
--- PASS: TestAccAWSAPIGatewayRestApi_openapi (12.58s)
=== RUN TestAccAWSAPIGatewayRestApi_basic
--- PASS: TestAccAWSAPIGatewayRestApi_basic (43.96s)
=== RUN TestAccAWSAPIGatewayRestApi_policy
--- PASS: TestAccAWSAPIGatewayRestApi_policy (118.16s)
This has been released in version 1.19.0 of the 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! |
Added execute_arn attribute as described in #3967