Created
March 20, 2021 15:44
-
-
Save ystoneman/5987d5667168598940949e9b22fa36b1 to your computer and use it in GitHub Desktop.
Find all the API Gateway APIs that have cache enabled in a given AWS region.
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
declare -a arr=($(aws apigateway get-rest-apis --query 'items[*].id' | tr ,[]\" ' ')) | |
for i in "${arr[@]}" | |
do | |
declare -a stages=($(aws apigateway get-stages --rest-api-id $i --query 'item[0].stageName' | tr \" ' ')) | |
for j in "${stages[@]}" | |
do | |
if $(aws apigateway get-stage --rest-api-id $i --stage-name $j | jq '.cacheClusterEnabled'); then | |
aws apigateway get-rest-api --rest-api-id $i | jq '.name' | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment