-
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
[Bug]: Referencing launch template version in autoscaling resource fails on apply if lt is modified #34867
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
It appears adding launch_template_version = "$Latest" fixes this. So, I will close this issue. It would be nice if the autoscaling module documentation was a bit more verbose. |
OK, I am going to reopen this. While putting $Latest as the version prevents the apply from erroring this will no longer will trigger an instance refresh. Because nothing in the ASG changes. I have followed the instance_refresh block docs for the aws_autoscaling_group resource and specified the launch template resource version in the mixed_instances configuration of the asg resource. I have even added a depends_on in the aws_autoscaling_group to try to prevent this. The plan shows that it is going to change the lt version in the ASG to null. When I apply the plan, the lt is modified, but then it fails to modify the asg because lt version null isn't valid.
|
Ran into this today. |
Same with mixed instances policy:
I have launch template configured to pick up the latest AMI as they are getting baked, and this configuration does not work. |
I suddenly have the same problem, just updated the aws terraform provider from 5.9.0 to 5.34.0. |
I ran into this issue as well, my work around was to change the trigger for instance refresh to be a tag. Not ideal, but will work for now. |
adding
in
is working for me. |
Terraform Core Version
1.6.5
AWS Provider Version
5.3.0
Affected Resource(s)
Expected Behavior
Any change to the launch template should create a new version of the template. That plan seems to show it is going to modify the launch template in place, and change the version to null ??? It should be showing "know after apply" maybe?
Actual Behavior
The apply fails.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
This also fails if I don't use the autoscalinggroup module and use the aws_autoscaling_group resource directly.
Steps to Reproduce
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: