Skip to content

Commit f8eef99

Browse files
committed
Disable script crash when getting exit code 254 from aws cli when deleting Lambda@Edge function
1 parent 7481349 commit f8eef99

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

deployment/delete_lambda

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ aws cloudfront wait distribution-deployed --id "$DISTRIBUTION_ID"
7171

7272
echo "CloudFront distribution updated. Proceeding with Lambda function deletion..."
7373

74+
# Adding the set +e command is necessary to ensure that the script does not terminate on an error,
75+
# allowing us to handle the exit code of the Lambda function deletion command manually.
76+
set +e
77+
7478
VERSIONS=$(aws lambda list-versions-by-function --function-name "$LAMBDA_ARN" --region "$REGION" | jq -r '.Versions[].Version')
7579
for version in $VERSIONS; do
7680
if [[ "$version" != "\$LATEST" ]]; then

0 commit comments

Comments
 (0)