How to rename an AWS API Gateway API instance?

12,266

Solution 1

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

Solution 2

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

Solution 3

It turns out, there is now a way to rename the API!

Under the Amazon API Gateway service, select APIs. You will see the list of your APIs.

List of APIs

Now, click the little cog wheel in the top right corner of the API that you wish to rename...

cog wheel

Simply change the name, hit save, and you're good!

editing UI

Solution 4

From https://console.aws.amazon.com/apigateway -> Select API by Name -> Settings -> General Settings -> Name

Solution 5

I know this is an old question, but people may still need an answer as I just did.

Amazon's AWS UI isn't always clear. There is no "Rename" function to change the name of an existing API. However, it can be done by cloning your existing API.

To rename your API, click the "Create API" button and select "Clone from existing API". This will allow you to give it a new name.

Share:
12,266
Tomas Romero
Author by

Tomas Romero

Updated on June 03, 2022

Comments

  • Tomas Romero
    Tomas Romero almost 2 years

    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.

  • Tomas Romero
    Tomas Romero over 8 years
    Thanks! Running: aws apigateway update-rest-api --rest-api-id miApiId --patch-operations op=replace,path=/name,value=testName worked.
  • Ezekiel Victor
    Ezekiel Victor over 7 years
    Thank you @canotto90. Saved me some time concocting that command.
  • Defozo
    Defozo over 7 years
    Why it's not available in the UI?
  • blueprintchris
    blueprintchris over 5 years
    Thank god they allowed us to change it in the console