After new code is pushed to lambda, I am running the following comands
Create new version from the $LATEST code
ver=$(aws lambda publish-version --function-name my-function --description "New version" --output text --query 'Version')
Point lambda alias to new version
aws lambda update-alias --function-name my-function --name dev --function-version $ver
Then if I check the Alias in AWS console, it still shows it is pointing to old version.
The screen shot below shows Alias is still pointing to old version.
If I wait for few mins and refresh the console then I see alias is pointing to new version.
Does it take time for Alias to point to new version? or is it just a console that is not getting updated configuration immediately.
3
Answers
It looks like you have canary deployment enabled. The canary configuration is creating the delay you’re seeing. If you want to propagate your changes instantly, I’d recommend disabling the canary deployment.
Canary Deployments with Alias Traffic Shifting
This seem to be common issues.
Just curious, do you have provisioned concurrency & autoscaling turned on?
You can try change the
description
to something different on everypublish-version
(but I doubt the change would be immediate with provisioned concurrency turned on)This works for me
API Version
Steps:
--routing -config AdditionalVersionWeights={}
(if any)When I Check the Alias Config through cli as well as Console, I got the expected output immediately
Before:
After: