-
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
feature request: update aws_instance resource to support declaring Shutdown behavior #2130
Comments
Hey @ketzacoatl thanks for writing in. At first pass that seems like we'd be leaving resources dangling (maybe not a big deal to some), with no way to re-connect Terraform to that instance. Running Is that the behavior you're thinking of? If there are others, please mention them and we'll think about things here. Thanks! |
I may have introduced confusion here by implying some kind of state management here ( Additionally, termination protection was recently added to the project in #1988 , which will be included in the next release of Terraform (should be in the next week or so). |
Hi @catsby, yes, I am referring to the Thank you also for the reference to the support for termination protection, I see similar functionality also in the As for this feature with the Shutdown behavior, if I guess if the instance is stopped, TF could ignore it, but might need to update/refresh state if the user starts the instance back up (out of band from TF). Similarly, if the instance is set to terminate on shutdown, and a fresh would show it as gone, and by default would try to re-create it. For the use cases I have, I would combine this with a conditional that allowed me to control when the new instance was re-created. |
We also want support for this option in Terraform, and would expect Terraform to re-create instances that have been terminated between two runs. We're exploring the use of Terraform for our build process. During the build, we want Terraform to launch a number of build slaves and configure them to poweroff after N minutes (AWS would then terminate them). If during those N minutes another build is triggered, the slaves already exist and the provisioner resets the poweroff timer. |
+1 to simply exposing the |
My favorite kind of notification. ❤️ @stack72 |
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. |
AWS instances can be configured to either stop or terminate when they shutdown. I do not see this documented https://terraform.io/docs/providers/aws/r/instance.html. The antithesis to this is supporting the termination protection flag. Thanks for considering!
The text was updated successfully, but these errors were encountered: