Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restoring API Gateway Resource from previous Deploy

/r1
 |- POST <-- accidentally deleted, want to restore
 |- GET <-- new method, will remove the POST from the previous deploy

One of the methods in one of our resources has been deleted. The resource is of course still in the most recent deploy, and we want to restore it so we can add, say, a GET method to the same resource.

If we just add the new GET and deploy, the POST will be removed. Is there no way to save and restore an API?

like image 476
Paddie Avatar asked Nov 27 '15 10:11

Paddie


3 Answers

2017- You can now export a stage as Swagger + API Gateway Extensions (Stages > [your stage] > Export > Swagger + API Gateway Extensions)and import it through Actions > Import API

like image 117
noɥʇʎԀʎzɐɹƆ Avatar answered Oct 20 '22 06:10

noɥʇʎԀʎzɐɹƆ


You can easily restore your AWS API Gateway from a previous deployment. Go to API Gateway and select your API. Then select Stages. Pick a stage that has the last version of your deployment that you want to restore. Select it and click the Export tab, and export the JSON + Swagger file. Then select the Resources tab and under actions click Import. Once you import your swagger file, your API Gateway resources will be restored to the version that was deployed to that aforementioned Stage. I hope this helps.

like image 28
VirtualProdigy Avatar answered Oct 20 '22 06:10

VirtualProdigy


Unfortunately this is not possible. You may want to manage your API moving forward using a Swagger or RAML definition and using the API import tool. Doing so will allow you to treat your API definition like source code, with tracking and ability to revert changes.

like image 45
Bob Kinney Avatar answered Oct 20 '22 07:10

Bob Kinney