Last active
December 5, 2018 18:43
-
-
Save niradler/bbe7e3042bf52ff26df1dc8cd24760b6 to your computer and use it in GitHub Desktop.
export all aws api gateway endpoint.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#for dev and prod stage, dont forget to install jq | |
aws apigateway get-rest-apis | jq '.items[].id' | sed s/\"// | sed s/\”// > api_ids.txt | |
for i in $(cat api_ids.txt); | |
do aws apigateway get-export --parameters extensions='postman' --rest-api-id $i --stage-name prod --export-type swagger ./apis/lambda/prod/$i.json; | |
echo $i ; | |
done ; | |
for i in $(cat api_ids.txt); | |
do aws apigateway get-export --parameters extensions='postman' --rest-api-id $i --stage-name dev --export-type swagger ./apis/lambda/dev/$i.json; | |
echo $i ; | |
done ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment