One of these days i had to rename a resource name on the AWS API GATEWAY, so here are the steps needed. In order to change your resource name you need to run 3 commands on the cli. One to get your API ID, one to get the Resource ID and one last command to change its name.
First lets gonna find the ID of the desired API. Using the aws cli type the following command:
First lets gonna find the ID of the desired API. Using the aws cli type the following command:
aws apigateway get-rest-apisThe API will return a json with an array of items containing all of your apis. Look into the name property to find the api that have the resource you need to change. Right above the name property you have the id property of your api. Take note of this id and run the following command with it to get the resource id.
aws apigateway get-resources --rest-api-id 1010101010Get the id matching the resource path that you are looking for to run the final command thats going to change your resource name.
aws apigateway update-rest-api --rest-api-id 1010101010 --patch-operations op=replace,path=/pathPart,value=path-new-nameNote that pathPart stays as is. Do not change its value. You only need to change the last one, replacing path-new-name with the name that you want.
Comments
Post a Comment