Created
May 7, 2019 18:58
-
-
Save CodySwannGT/25bced7ca57f446e8b6ecb2d8cb500b6 to your computer and use it in GitHub Desktop.
Get API Gateway endpoints
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=$(aws configure get region) | |
REST_APIS=$(aws apigateway get-rest-apis --query items[*].id --output text) | |
for i in $(echo $REST_APIS | tr " " "\n") | |
do | |
STAGES=$(aws apigateway get-stages --rest-api-id $i --query item[*].stageName --output text) | |
for j in $(echo $STAGES | tr " " "\n") | |
do | |
PATHS=$(aws apigateway get-resources --rest-api-id $i --query items[*].path --output text) | |
for k in $(echo $PATHS | tr " " "\n") | |
do | |
echo "https://${i}.execute-api.${REGION}.amazonaws.com/${j}${k}" | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment