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

provider/aws: Expose execution ARN + invoke URL for APIG deployment #13889

Merged
merged 1 commit into from Apr 24, 2017

Conversation

radeksimko
Copy link
Member

The URL is useful for humans wanting to call the URL easily straight away and ARN for Lambda Permission.

Before

resource "aws_lambda_permission" "apigw_lambda" {
  statement_id  = "AllowExecutionFromAPIGateway"
  action        = "lambda:InvokeFunction"
  function_name = "${aws_lambda_function.lambda.arn}"
  principal     = "apigateway.amazonaws.com"

  source_arn = "arn:aws:execute-api:${var.region}:${var.account_id}:${aws_api_gateway_rest_api.demo.id}/${var.stage_name}/*"
}

output "invoke_url" {
  value = "https://${aws_api_gateway_rest_api.demo.id}.execute-api.${var.region}.amazonaws.com/${var.stage_name}"
}

After

resource "aws_lambda_permission" "apigw_lambda" {
  statement_id  = "AllowExecutionFromAPIGateway"
  action        = "lambda:InvokeFunction"
  function_name = "${aws_lambda_function.lambda.arn}"
  principal     = "apigateway.amazonaws.com"

  source_arn = "${aws_api_gateway_deployment.demo.execution_arn}/*"
}

output "invoke_url" {
  value = "${aws_api_gateway_deployment.demo.invoke_url}"
}

@radeksimko radeksimko force-pushed the f-aws-apig-deployment-computed branch from 962a2e1 to aa6623f Compare April 24, 2017 06:04
@stack72
Copy link
Contributor

stack72 commented Apr 24, 2017

Will this also need noted as an incompatibility?

@radeksimko
Copy link
Member Author

@stack72 🤔 not sure I understand how could this change be incompatible with anything? We're introducing 2 new fields which users may or may not want to use.

@stack72
Copy link
Contributor

stack72 commented Apr 24, 2017

My apologies that it's a new field :)

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@radeksimko radeksimko merged commit 3c2a40a into master Apr 24, 2017
@radeksimko radeksimko deleted the f-aws-apig-deployment-computed branch April 24, 2017 18:44
@ghost
Copy link

ghost commented Apr 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants