From cb53ae437f97e9f43225ae3176e5e2bcbe22b2c5 Mon Sep 17 00:00:00 2001 From: ASD RAJA Date: Fri, 30 May 2025 20:40:18 +0530 Subject: [PATCH] Fix: Improve region state check --- cloudwatch-logs-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudwatch-logs-cleanup.sh b/cloudwatch-logs-cleanup.sh index 2b17f44..8c71030 100755 --- a/cloudwatch-logs-cleanup.sh +++ b/cloudwatch-logs-cleanup.sh @@ -106,7 +106,7 @@ function GetRegions(){ echo "Begin GetRegions Function" fi AWSregions=$(aws ec2 describe-regions --output=json --profile $profile 2>&1) - if echo "$AWSregions" | egrep -iq "error|not"; then + if echo "$AWSregions" | egrep -iq "error|not-opted-in"; then fail "$AWSregions" else ParseRegions=$(echo "$AWSregions" | jq '.Regions | .[] | .RegionName'| cut -d \" -f2 | sort)