-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Downgrading ec2 instance type from t2.small to t2.micro "forces new resource" #9157
Comments
Hi @jleclanche! Currently Terraform doesn't have a way to model actions that require temporarily stopping an instance. This is being discussed over in #1579. I think robust support for managing the multi-step process of stopping, altering and re-starting will be a pre-requisite for this, though this would definitely be a great additional feature to support once that's in place. |
@apparentlymart Are we talking about the same thing? Terraform does support upgrading the instance, which has the exact same prerequisite (stopping and then restarting the instance). Or am I missing something? |
If by "upgrading" you mean replacing I think I must not be understanding what you are asking about here... could you perhaps show an example output of |
This is the weirdest thing. I'm changing a But yes, you got it, that's what I've been seeing: instance_type "upgrades" are fine, but downgrades force a new resource. Although now I'm seeing downgrades everywhere. Hrm. Also worth noting I don't see this "forces new resource" problem on RDS instances at all. |
Terraform devs: Please keep this issue open until TF can properly handle stop/start/restart of instances - as described in #1579 and similar. Once we can stop/start instances, then changing the instance type (or size) without destroy/recreate should be easy to handle from within Terraform. |
new instance Fixes: #9157 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/16 15:13:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m === RUN TestAccAWSInstance_changeInstanceType --- PASS: TestAccAWSInstance_changeInstanceType (303.85s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 303.876s ```
new instance Fixes: #9157 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/16 15:13:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m === RUN TestAccAWSInstance_changeInstanceType --- PASS: TestAccAWSInstance_changeInstanceType (303.85s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 303.876s ```
new instance Fixes: #9157 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/16 15:13:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m === RUN TestAccAWSInstance_changeInstanceType --- PASS: TestAccAWSInstance_changeInstanceType (303.85s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 303.876s ```
new instance Fixes: #9157 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/16 15:13:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m === RUN TestAccAWSInstance_changeInstanceType --- PASS: TestAccAWSInstance_changeInstanceType (303.85s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 303.876s ```
…#11998) new instance Fixes: #9157 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/16 15:13:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m === RUN TestAccAWSInstance_changeInstanceType --- PASS: TestAccAWSInstance_changeInstanceType (303.85s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 303.876s ```
…#11998) new instance Fixes: #9157 ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_changeInstanceType' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/16 15:13:21 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_changeInstanceType -timeout 120m === RUN TestAccAWSInstance_changeInstanceType --- PASS: TestAccAWSInstance_changeInstanceType (303.85s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 303.876s ```
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. |
Terraform Version
Terraform v0.7.4
Affected Resource(s)
Terraform Configuration Files
Downgrading the
instance_type
will force a new resource. Upgrading it however, will not. I have seen this on several different instance types such as t2.small, t2.large, m4.xlarge and m4.2xlarge.I have also verified that I was able to manually go in the AWS console, stop the instance, downgrade it and restart the instance without having to recreate it.
The text was updated successfully, but these errors were encountered: