Created
August 20, 2018 15:21
-
-
Save wobondar/a8b5d7b609e0db8ce4231baafec09965 to your computer and use it in GitHub Desktop.
AWS export all API gateways with stages
This file contains hidden or 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
| aws apigateway get-rest-apis > apis.json | |
| rm -rf apis | |
| mkdir apis | |
| jq -r '.items[] | .id' apis.json | while read i; do | |
| aws apigateway get-stages --rest-api-id $i > stages.json | |
| jq -r '.item[] | .stageName' stages.json | while read z; do | |
| aws apigateway get-export --rest-api-id $i --stage-name $z --export-type 'swagger' "apis/$z-$i.json" | |
| done | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment