Fix AccessDenied issue (#1025)

This commit is contained in:
Leonardo Azize Martins
2022-02-04 14:05:10 -03:00
committed by GitHub
parent 1d409d04f2
commit 3ecb5dbce6

View File

@@ -40,7 +40,11 @@ extra760(){
for lambdafunction in $LIST_OF_FUNCTIONS;do for lambdafunction in $LIST_OF_FUNCTIONS;do
LAMBDA_FUNCTION_FOLDER="$SECRETS_TEMP_FOLDER/extra760-$lambdafunction-$regx" LAMBDA_FUNCTION_FOLDER="$SECRETS_TEMP_FOLDER/extra760-$lambdafunction-$regx"
LAMBDA_FUNCTION_FILE="$lambdafunction-code.zip" LAMBDA_FUNCTION_FILE="$lambdafunction-code.zip"
LAMBDA_CODE_LOCATION=$($AWSCLI lambda get-function $PROFILE_OPT --region $regx --function-name $lambdafunction --query Code.Location --output text) LAMBDA_CODE_LOCATION=$($AWSCLI lambda get-function $PROFILE_OPT --region $regx --function-name $lambdafunction --query Code.Location --output text 2>&1)
if [[ $(echo "$LAMBDA_CODE_LOCATION" | grep AccessDenied) ]]; then
textInfo "$regx: Access Denied trying to get Lambda functions" "$regx" "$lambdafunction"
continue
fi
mkdir $LAMBDA_FUNCTION_FOLDER mkdir $LAMBDA_FUNCTION_FOLDER
# DOWNLOAD the code in a zip file # DOWNLOAD the code in a zip file
curl -s $LAMBDA_CODE_LOCATION -o $LAMBDA_FUNCTION_FOLDER/$LAMBDA_FUNCTION_FILE curl -s $LAMBDA_CODE_LOCATION -o $LAMBDA_FUNCTION_FOLDER/$LAMBDA_FUNCTION_FILE