Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreliable deployment #679

Open
sterliakov opened this issue Oct 30, 2024 · 0 comments
Open

Unreliable deployment #679

sterliakov opened this issue Oct 30, 2024 · 0 comments

Comments

@sterliakov
Copy link

sterliakov commented Oct 30, 2024

This action releases a code version and immediately updates an alias to point to that version. This is never the desired outcome: new version takes some time to become available. This can result in failures similar to this one.

AWS CLI supports checks to facilitate preventing such premature deployments: lambda wait function-updated-v2 and lambda wait function-active-v2. This should be also doable via JS SDK.

Here's an AWS CLI version that prevents deploying unavailable functions:

set -euo pipefail
version=$(
    aws lambda update-function-code --publish \
    --function-name "$function" \
    --image-uri "$image" \
    | jq -r '.Version'
)
aws lambda wait function-updated-v2 --function-name "$function"
aws lambda wait function-active-v2 --function-name "$function"
aws lambda update-alias \
    --name "$alias_name" \
    --function-name "$function" \
    --function-version "$version"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant