How to update AWS API Gateway Resource Name

I wanted to update the endpoint name on the AWS API gateway.

I tried to find the options through AWS Console, but failed. I couldn’t find the way.
I found that we can do through CLI.

First get the API ID & Resource ID that you want to change from AWS Console.

Or you can get this from AWS CLI.
Note: You might have already AWS Credential file on your machine.

Run following code to get the list of APIs and found the API that you want to change.

aws apigateway get-rest-apis

Run following code to get the resource id with the API Id found from above command.

aws apigateway get-resources --rest-api-id <api-id>

Then Run following code to update the name in <new-name> section.

aws apigateway update-resource --rest-api-id <api-id> --resource-id <resource-id> --patch-operations op=replace,path=/pathPart,value=<new-name>

Leave a Reply