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

user3559247 picture user3559247 · Jan 30, 2018 · Viewed 11.1k times · Source

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?

Answer

user3559247 picture user3559247 · Jan 31, 2018

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}