Skip to content

feat(apigateway): Add stage ARN attribute#18170

Merged
mergify[bot] merged 2 commits intoaws:masterfrom
laurelmay:add-apigateway-arns
Dec 26, 2021
Merged

feat(apigateway): Add stage ARN attribute#18170
mergify[bot] merged 2 commits intoaws:masterfrom
laurelmay:add-apigateway-arns

Conversation

@laurelmay
Copy link
Copy Markdown
Contributor

This adds an attribute to retrieve the resource ARN of a stage (not the
execute-api ARN). This is useful when integrating with services such as
WAF or when writing IAM policies for managing the API.

ARNs for v1 REST APIs are at https://docs.aws.amazon.com/apigateway/latest/developerguide/arn-format-reference.html#apigateway-v1-arns


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Dec 25, 2021

@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Dec 25, 2021
This adds an attribute to retrieve the resource ARN of a stage (not the
execute-api ARN). This is useful when integrating with services such as
WAF or when writing IAM policies for managing the API.
@laurelmay laurelmay force-pushed the add-apigateway-arns branch 2 times, most recently from 80e9384 to b49eb9a Compare December 25, 2021 03:19
service: 'apigateway',
account: '',
resource: 'restapis',
resourceName: `${this.restApi.restApiId}/stages/${this.stageName}`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What if this.stageName is unresolved? Can that happen?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It should always be a Ref to the CfnStage (L257), which would be safe to concatenate here. I'm not sure if it'd be possible for it to be any other type of token since it's not based on the input via StageOptions/StageProps directly.

@otaviomacedo otaviomacedo added the pr-linter/exempt-readme The PR linter will not require README changes label Dec 26, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Dec 26, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: c455d9a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit be7acfd into aws:master Dec 26, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Dec 26, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@laurelmay laurelmay deleted the add-apigateway-arns branch December 27, 2021 14:46
@laurelmay laurelmay restored the add-apigateway-arns branch December 27, 2021 14:46
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
This adds an attribute to retrieve the resource ARN of a stage (not the
execute-api ARN). This is useful when integrating with services such as
WAF or when writing IAM policies for managing the API.

ARNs for v1 REST APIs are at https://docs.aws.amazon.com/apigateway/latest/developerguide/arn-format-reference.html#apigateway-v1-arns

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-apigateway Related to Amazon API Gateway pr-linter/exempt-readme The PR linter will not require README changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants