Fix listing CloudFormation stacks if default output format is not JSON

This commit is contained in:
Geert Smelt
2020-06-26 11:55:12 +02:00
parent a0c58e1cb2
commit 63d06212db

View File

@@ -26,7 +26,7 @@ extra742(){
textInfo "Looking for secrets in CloudFormation output across all regions... "
for regx in $REGIONS; do
CFN_STACKS=$($AWSCLI cloudformation describe-stacks $PROFILE_OPT --region $regx)
CFN_STACKS=$($AWSCLI cloudformation describe-stacks $PROFILE_OPT --region $regx --output json)
LIST_OF_CFN_STACKS=$(echo $CFN_STACKS | jq -r '.Stacks[].StackName')
if [[ $LIST_OF_CFN_STACKS ]];then
for stack in $LIST_OF_CFN_STACKS; do