hamin.se
  • About
  • All posts

Export Many API Gateways to a Swagger format in json - Fri, Nov 10, 2017

#!/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        

Back to Home


© 2024 | Built on Hugo

Twitter Linkedin GitHub