Skip to content

Commit 967e577

Browse files
authored
Merge pull request #24 from toluna-terraform/fix-version_skip
Fix deployment failure when missing lambda version
2 parents 5dbf742 + 4ecb8c6 commit 967e577

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/pre_buildspec.yml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ phases:
2323
aws lambda wait function-updated --function-name $FUNCTION_NAME
2424
TARGET_VERSION=$(aws lambda publish-version --function-name $FUNCTION_NAME --query 'Version' --output text)
2525
aws lambda wait published-version-active --function-name $FUNCTION_NAME --qualifier $TARGET_VERSION
26-
CURRENT_VERSION=$(echo "$(($TARGET_VERSION-1))")
26+
CURRENT_VERSION=$(aws lambda get-alias --function-name $FUNCTION_NAME --name live --query 'FunctionVersion' --output text)
2727
echo $APPSPEC > appspec.json
2828
sed -i -E 's/<FUNCTION_NAME>/'$FUNCTION_NAME'/' appspec.json
2929
sed -i -E 's/<CURRENT_VERSION>/'$CURRENT_VERSION'/' appspec.json

0 commit comments

Comments
 (0)