Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find the arn of an api gateway stage?

Tags:

I am trying to use awscli to add tags to my api gateway stage https://docs.aws.amazon.com/cli/latest/reference/apigateway/tag-resource.html

I am required to supply the --resource-arn for the stage, however I am unable to ascertain this value.

I have tried using both awscli and the console to determine this value, but have been unable to find what the arn for the api gateway stage is. I have also tried guessing based off arn pattern/formats.

How can I determine this value, or alternatively what is the format for this arn?

like image 276
user3559247 Avatar asked Jan 30 '18 05:01

user3559247


People also ask

Does API gateway have an Arn?

The following tables list the Amazon Resource Names (ARNs) for API Gateway resources. To learn more about using ARNs in AWS Identity and Access Management policies, see How Amazon API Gateway works with IAM and Control access to an API with IAM permissions.

What is stage name API gateway?

To deploy an API, you create an API deployment and associate it with a stage. A stage is a logical reference to a lifecycle state of your API (for example, dev , prod , beta , v2 ). API stages are identified by the API ID and stage name. They're included in the URL that you use to invoke the API.

What is stage variable in AWS API gateway?

There's a new feature on Amazon API Gateway called stage variables. Stage variables act like environment variables and can be used to change the behavior of your API Gateway methods for each deployment stage; for example, making it possible to reach a different back end depending on which stage the API is running on.


2 Answers

At the very bottom there are samples for different APIGW artifacts, last one is stage.

arn:aws:apigateway:region::/restapis/api-id/stages/stage-name

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-control-access-using-iam-policies-to-create-and-manage-api.html

like image 29
Andras Gombosi Avatar answered Sep 28 '22 20:09

Andras Gombosi


I finally found the format for an api gateway stage at aws docs for set up tags via the API Gateway REST API.

The format for the ARN is arn:aws:apigateway:{region}::/restapis/{rest_api_id}/stages/{stage_name}

like image 164
user3559247 Avatar answered Sep 28 '22 20:09

user3559247