Fix #940 handling error when can not list functions

This commit is contained in:
Toni de la Fuente committed 2021-12-09 12:19:45 +01:00
1 parent 78faa8f365
commit 49ea3d8589
1 file changed
+5 -1
+5 -1
View File
@@ -31,7 +31,11 @@ extra760(){
fi
for regx in $REGIONS; do
LIST_OF_FUNCTIONS=$($AWSCLI lambda list-functions $PROFILE_OPT --region $regx --query Functions[*].FunctionName --output text)
LIST_OF_FUNCTIONS=$($AWSCLI lambda list-functions $PROFILE_OPT --region $regx --query Functions[*].FunctionName --output text 2>&1)
if [[ $(echo "$LIST_OF_FUNCTIONS" | grep AccessDenied) ]]; then
textFail "$regx: Access Denied trying to list Lambda functions" "$regx" "$lambdafunction"
continue
fi
if [[ $LIST_OF_FUNCTIONS ]]; then
for lambdafunction in $LIST_OF_FUNCTIONS;do
LAMBDA_FUNCTION_FOLDER="$SECRETS_TEMP_FOLDER/extra760-$lambdafunction-$regx"