From a0c58e1cb2249c7b839a1ebc6ecd99765bbfc146 Mon Sep 17 00:00:00 2001 From: Geert Smelt Date: Fri, 26 Jun 2020 11:25:16 +0200 Subject: [PATCH] Fix listing EC2 Security Groups if default output format is not JSON --- checks/check_extra75 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/check_extra75 b/checks/check_extra75 index 91a34df3..11179a61 100644 --- a/checks/check_extra75 +++ b/checks/check_extra75 @@ -24,7 +24,7 @@ extra75(){ textInfo "Looking for Security Groups in all regions... " for regx in $REGIONS; do - SECURITYGROUPS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --max-items $MAXITEMS | jq '.SecurityGroups|map({(.GroupId): (.GroupName)})|add') + SECURITYGROUPS=$($AWSCLI ec2 describe-security-groups $PROFILE_OPT --region $regx --max-items $MAXITEMS --output json | jq '.SecurityGroups|map({(.GroupId): (.GroupName)})|add') if [[ $SECURITYGROUPS == "null" ]]; then continue