-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Lifecycle rules on launch config create cyclic dependency during 'destroy' #3294
Comments
+1 |
1 similar comment
👍 |
@gposton are you giving your LaunchConf a name? |
@stack72 The name includes the AMI-ID, so it will be unique each time.
|
I updated the issue description... please see the last 4 paragraphs. |
I added a template that demonstrates this issue here: https://gist.github.com/gposton/0b51dea975d9250b6c99 Note that running the template allows you to update the AMI without cycling the instances in the ASG
However, 'destroy' introduces a cycle
|
See also #2359. |
👍 |
Anyone have a viable workaround for this? |
I've been able to reproduce this using a rather complex module-based config. It's hard to paste it all here, but it works just fine during update and what not (after I effected Just by looking at documented behaviour, the only meaningful lifecycle config option out of the three that would have any value in a Maybe during walking dependencies on a |
Hello! 🤖 This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it. If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform. 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
It seems to me that lifecycle rules should be ignored during the 'destroy' action.
I have a terraform template that consists of an ASG and launch config (among other things).
Without lifecycle rules the initial 'apply' and a subsequent 'destroy' work as expected.
However, I am unable to update the AMI in the launch config, as I get this error:
So I added the lifecycle rule to the launch config.
Now I can do the initial 'apply', and can also do another apply to change the AMI. Everything works as expected.... except 'destroy'. When I run a destroy, I now get the following error:
I can follow the documentation and add the lifecycle rule to the asg as well. This makes everything run successfully from terraform's perspective. However, this has unintended consequences.
When the lifecycle rule is not on the ASG, I can change the AMI in the launch config w/o the ASG being destroyed (thus cycling my instances).
When the lifecycle rule is added to the ASG, both the ASG and the launch config is destroyed and re-created. This cycles my instances which happens too quickly for all of our services to initialize and pass health checks.
I'd prefer the former scenario, where the ASG is not cycled. However, with that scenario (which works from an 'apply' perspective) I can not run 'destroy' without introducing a cycle
The text was updated successfully, but these errors were encountered: