Last active
September 22, 2017 09:38
-
-
Save hmain/cc2cc763859afe517adbad19ca12f1be to your computer and use it in GitHub Desktop.
Download AWS Api Gateway swagger json with the AWS cli
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
#!/bin/bash | |
REGION="eu-west-1" | |
ITEMS=$(aws --region eu-west-1 apigateway get-rest-apis | jq -r '.items[] | .id') | |
STAGE="prod" | |
for item in $ITEMS | |
do | |
aws --region $REGION \ | |
apigateway get-export \ | |
--parameters '{"extensions":"integrations,authorizers"}' \ | |
--rest-api-id $item \ | |
--stage-name $STAGE \ | |
--export-type swagger $item-$STAGE.json | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added --parameters '{"extensions":"integrations,authorizers"}' \ as per amazon-archives/aws-apigateway-importer#169 (comment)