-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
ForceNew on Lambda alias name change #4106
Conversation
This test demonstrates the bug in #4090
The name functions as the "id" here, with regards to identifying the alias for an update operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix! 🚀
2 tests passed (all tests)
=== RUN TestAccAWSLambdaAlias_basic
--- PASS: TestAccAWSLambdaAlias_basic (26.95s)
=== RUN TestAccAWSLambdaAlias_nameupdate
--- PASS: TestAccAWSLambdaAlias_nameupdate (34.92s)
testAccCheckAwsLambdaAliasExists("aws_lambda_alias.lambda_alias_test", &conf), | ||
testAccCheckAwsLambdaAttributes(&conf), | ||
resource.TestMatchResourceAttr("aws_lambda_alias.lambda_alias_test", "arn", | ||
regexp.MustCompile(`^arn:aws:lambda:[a-z]+-[a-z]+-[0-9]+:\d{12}:function:`+funcName+`:`+aliasName+`$`)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future note: When we start testing outside the aws
partition (e.g. US Government) these will break. We can go with something like ^arn:[^:]+:lambda:
..., create a partition regex constant, or create our own test check wrapper function for AWS ARNs.
This has been released in version 1.14.1 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
When updating a Lamda Alias, the API uses the
name
as the ID of the alias to update. When updating thename
ofaws_lambda_alias
, we're sending the newname
from the config, which isn't found, so Terraform errors.The next
plan
reads the newname
from the config, and shows an addition to be made (not an update). Applying then creates a new alias, and orphans the old one.91d8b16 is a regression test that will fail on the current
master
(84353e4)Fixes #4090