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

aws_api_gateway_rest_api: Add execute_arn computed attribute #3968

Merged
merged 6 commits into from
May 11, 2018

Conversation

mewa
Copy link
Contributor

@mewa mewa commented Mar 28, 2018

Added execute_arn attribute as described in #3967

@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Mar 28, 2018
@radeksimko radeksimko added service/apigateway Issues and PRs that pertain to the apigateway service. enhancement Requests to existing resources that expand the functionality or scope. labels Mar 29, 2018
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Apr 2, 2018
@mewa mewa changed the title [WIP] aws_api_gateway_rest_api: Add execute_arn computed attribute aws_api_gateway_rest_api: Add execute_arn computed attribute Apr 2, 2018
Copy link
Contributor

@bflad bflad left a 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)
Copy link
Contributor

@bflad bflad Apr 20, 2018

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
Copy link
Contributor

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?

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Apr 26, 2018
@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label May 10, 2018
@mewa
Copy link
Contributor Author

mewa commented May 10, 2018

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.

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label May 11, 2018
@bflad bflad added this to the v1.19.0 milestone May 11, 2018
Copy link
Contributor

@bflad bflad left a 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)

@bflad bflad merged commit 7d28327 into hashicorp:master May 11, 2018
bflad added a commit that referenced this pull request May 11, 2018
@bflad
Copy link
Contributor

bflad commented May 17, 2018

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.

@ghost
Copy link

ghost commented Apr 6, 2020

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 Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants