Skip to content

Commit 2c66d57

Browse files
committed
fix(lambda-function): remove duplicate ECR login from deploy script
The deploy script was performing ECR login twice - once explicitly and once within the build-and-push.sh script. Removed the duplicate login to streamline the deployment process.
1 parent 205bc70 commit 2c66d57

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

examples/lambda-function/deploy.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ echo ""
4747
echo "Step 5: Deploying infrastructure..."
4848
terraform apply -auto-approve
4949

50+
# Step 6: Force Lambda to pull new image
51+
echo ""
52+
echo "Step 6: Forcing Lambda function update..."
53+
FUNCTION_NAME=$(terraform output -raw function_name)
54+
aws lambda update-function-code \
55+
--function-name ${FUNCTION_NAME} \
56+
--image-uri ${ECR_REPO}:${IMAGE_TAG} \
57+
--region ${AWS_REGION} > /dev/null
58+
5059
echo ""
5160
echo "=== Deployment Complete ==="
5261
FUNCTION_URL=$(terraform output -raw function_url)

0 commit comments

Comments
 (0)