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_apigatewayv2_stage does not output execution_arn #14554

Closed
eimantas-gecas-axomic opened this issue Aug 11, 2020 · 5 comments · Fixed by #14638
Closed

aws_apigatewayv2_stage does not output execution_arn #14554

eimantas-gecas-axomic opened this issue Aug 11, 2020 · 5 comments · Fixed by #14638
Assignees
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Milestone

Comments

@eimantas-gecas-axomic
Copy link

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 other comments that do not add relevant new information or questions, 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 CLI and Terraform AWS Provider Version

Terraform v0.12.23

  • provider.aws v3.1.0

Affected Resource(s)

  • aws_apigatewayv2_stage

Terraform Configuration Files

resource aws_apigatewayv2_api this {
  name = "test_api"
  protocol_type = "HTTP"
}

resource aws_apigatewayv2_stage default {
  api_id = aws_apigatewayv2_api.this.id
  name = "$default"
  auto_deploy = true
}

Debug Output

Panic Output

Expected Behavior

aws_apigatewayv2_stage.default.execution_arn should equal to something similar to arn:aws:execute-api:us-east-1:538692352:g34t324gr/*/$default

Actual Behavior

aws_apigatewayv2_stage.default.execution_arn is empty

@ghost ghost added the service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Aug 11, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 11, 2020
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 11, 2020
@ewbankkit
Copy link
Contributor

ewbankkit commented Aug 11, 2020

@eimantas-gecas-axomic Thanks for raising this issue.
Indeed, this seems to be an oversight as both the original blog post

Don’t forget that you will need to add a Lambda resource policy permission to the function to allow API Gateway to invoke > your function. For example:

aws lambda add-permission
--statement-id dd0dffb7-971e-5952-9699-38493cf34293
--action lambda:InvokeFunction
--function-name "arn:aws:lambda:us-west-1:[your account number]:function:Echo"
--principal apigateway.amazonaws.com
--source-arn "arn:aws:execute-api:us-west-1:[your account number]:[your gateway id]/"

and the relevant Troubleshooting section of the Developer Guide

developer-guide-execute-arn

mention adding a Lambda resource policy permission with the execution_arn value as the source ARN.
I'll address this.

@ewbankkit ewbankkit self-assigned this Aug 11, 2020
@ewbankkit
Copy link
Contributor

As the AWS documentation states that the REST and HTTP execute-api ARN formats are the same we'll output the execution_arn attribute in the same format as the aws_api_gateway_stage resource's equivalent:

arn:partition:execute-api:region:account-id:api-id/stage

@bflad
Copy link
Contributor

bflad commented Aug 14, 2020

The fix for this has been merged and will release with version 3.3.0 of the Terraform AWS Provider, next week. Thanks to @ewbankkit for the fix. 👍

@ghost
Copy link

ghost commented Aug 20, 2020

This has been released in version 3.3.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 Sep 13, 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 Sep 13, 2020
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/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
3 participants