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

断了今生、忘了曾经 提交于 2020-05-26 10:32:11

问题


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?


回答1:


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}




回答2:


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




回答3:


According to the AWS doc:

Amazon Resource Names (ARNs) uniquely identify AWS resources. We require an ARN when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.

Amazon Resource Names (ARNs) uniquely identify AWS resources

If you find out that AWS doc is tedious, try to read: An ARN adheres to several general naming conventions, depending on the AWS cloud service that is in use.



来源:https://stackoverflow.com/questions/48514180/how-can-i-find-the-arn-of-an-api-gateway-stage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!