-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
aws_lambda_alias not updating on new aws_lambda_function version #13099
Comments
Exactly the same problem here. I tried to use a lambda alias named "prod" to point to the latest published version. However, when I modify the lambda function configuration and set the publish=true, the function gets a new version, but the alias doesn't get updated to the new version. |
Yup, same here! |
This seems to be a regression of #2915 |
I think I may have found the reason. I opened this ticket with my best guess at the cause. #14210. Copied here: Guess at CauseI believe I have found the cause but I'd hope someone can confirm. It seems that the auto-publish feature is used in updating lambdas. This API call to AWS will return the updated version. However the AWS provider doesn't appear to use that version and instead appears to call get-function-versions and grab the largest version from the return list and use that value. However, I've confirmed with AWS Support that get-function-versions isn't a strongly consistent call and in fact is eventually consistent and has a cache TTL (length unknown). I believe that the calls to get-function-versions sometimes returns stale data and so the new version is not present. To solve this issue the AWS provider should use the version returned from the update-function call (create-function call too if that's relevant). |
This has been released in version 3.29.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Terraform: v0.12.24
provider.aws: v2.59.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
The aws_lambda_funcion resource gets updated to a new version, because publish=true. The aws_lambda_alias resource gets updated to the new version of aws_lambda_function.
Actual Behavior
The aws_lambda_funcion resource gets updated to a new version, because publish=true. The aws_lambda_alias does not get updated until the next apply.
Steps to Reproduce
terraform apply
-> aws_lambda_function gets updatedterraform apply
-> aws_lambda_alias gets updatedImportant Factoids
References
The text was updated successfully, but these errors were encountered: