Skip to content
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

start/stop instances - should close #22, #1998 and maybe #50 #1980

Closed

Conversation

artburkart
Copy link
Contributor

@artburkart artburkart commented Oct 20, 2017

I've added a couple acceptance tests for this feature. Since I'd already taken a stab at this about a year ago and never thought of a good way to deal with the transition from terminated to stopped and don't really think it's necessary to get the brunt of the value here, I've made it so you can only set instance_state to stopped or running. You can even set an instance to stopped at creation time, which might be useful for something, ¯_(ツ)_/¯. Also, while writing my tests, I realized you can't stop instances when their root block device is of type instance-store. I had no idea.

I haven't had a ton of luck getting my code merged into this code base, so please don't hesitate to tell me if there's something I can do to improve this PR.

Cheers!

UPDATE: Also going to reference hashicorp/terraform#1579 here so people know I did it.

@radeksimko radeksimko added enhancement Requests to existing resources that expand the functionality or scope. thinking labels Oct 21, 2017
@artburkart artburkart changed the title start/stop instances - should close #22 and maybe #50 start/stop instances - should close #22, #1998 and maybe #50 Nov 9, 2017
@artburkart
Copy link
Contributor Author

🤔 🤔 🤔

@radeksimko radeksimko added the size/L Managed by automation to categorize the size of a PR. label Nov 15, 2017
@artburkart
Copy link
Contributor Author

What does "size/L" mean?

@radeksimko radeksimko added upstream-terraform Addresses functionality related to the Terraform core binary. and removed thinking labels Dec 5, 2017
@ericofusco
Copy link

@artburkart @radeksimko

I believe this implementation should be improved in order to use with other attributes that don't require the resource to be recreated, just state to be temporarily changed to make the changes.

For example we also have the attributes user_data and ebs_optimized that require the instance to be at stopped state and the instance is recreated for them which is not necessary.

One approach that I suggest is adding another setting to the attribute like ForceNew that tells which state the resource should be at before making that change. Once the changes are verified terraform checks if resource needs to be at one particular state and changes the resource first and then make the changes and returns to the original value if it's different from the required one. Ignore that if resource needs to be recreated. Maybe something that could be added to terraform core instead of aws provider.

Also terraform should tell that the resource will be changed from "running" to "stopped" on this case, users should know that, when instance_type is changed now terraform shows the change like it changing while the instance is running, it doesn't show that a particular state is required and it might impact user's production environment by stopping the instance.

Please let me know youf thoughts.

@artburkart
Copy link
Contributor Author

@ericofusco - All good thoughts. I'm not interested in supporting this PR. If someone would like to take the code and improve it, I'll leave my branch around for them to use. In the meantime, I'll close this PR in favor of someone else taking ownership. Cheers!

@ghost
Copy link

ghost commented Apr 10, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. size/L Managed by automation to categorize the size of a PR. upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants