Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename an AWS API Gateway API instance?

In AWS API Gateway, is it possible to rename an API instance somehow?

I don't see the option on the UI, but maybe it's possible by using some API call.

like image 405
Tomas Romero Avatar asked Dec 17 '15 14:12

Tomas Romero


People also ask

How do I get an API domain name?

You create a certificate for the given domain name (or import a certificate), set up the domain name in API Gateway with the ARN of the certificate provided by ACM, and map a base path under the custom domain name to a deployed stage of the API.


2 Answers

Yes it's available in the API or CLI.

In the API you use a PATCH request on the 'name' field. http://docs.aws.amazon.com/apigateway/api-reference/resource/rest-api/

In the CLI, see docs http://docs.aws.amazon.com/cli/latest/reference/apigateway/update-rest-api.html

The PATCH op is 'replace' and the path would be '/name'

Edit: Thanks @Canotto90 for the example

aws apigateway update-rest-api --rest-api-id IDOfTheAPIThatNeedsTobeUpdated --patch-operations op=replace,path=/name,value=NewName

like image 188
jackko Avatar answered Sep 26 '22 18:09

jackko


Here is how you can get the list of APIs and their IDs:

aws apigateway get-rest-apis 

Use the Id to update name of API as mentioned by Canotto90 above:

aws apigateway update-rest-api --rest-api-id IDOfTheAPIThatNeedsTobeUpdated --patch-operations op=replace,path=/name,value=NewName 
like image 27
rahul Avatar answered Sep 24 '22 18:09

rahul