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

terraform plan states no change yet terraform apply destoryed all instances after subnet id change. #3163

Closed
rodrickbrown opened this issue Sep 3, 2015 · 3 comments · Fixed by #3173

Comments

@rodrickbrown
Copy link

I made a simple subnet-id change in my configuration

After running terraform plan I noticed the following -- "Not sure what forces new resource means"
subnet_id: "subnet-5632b421" => "subnet-38da1561" (forces new resource)

I wasn't too worried because terraform plan showed the following output --
Plan: 0 to add, 24 to change, 0 to destroy.

After running terraform apply -- TF destroyed all my EC2 instances in this resource.
aws_instance.prod-mesos-master.0: Destroying...
aws_instance.prod-mesos-slave.2: Destroying...
aws_instance.prod-mesos-master.1: Destroying...
aws_instance.prod-mesos-master.2: Destroying...
aws_instance.prod-mesos-slave.3: Destroying...
aws_instance.prod-mesos-slave.4: Destroying...
aws_instance.prod-mesos-slave.0: Destroying...
aws_instance.prod-mesos-slave.1: Destroying...

The output when it was completed was --
Apply complete! Resources: 8 added, 16 changed, 8 destroyed.

I'm using Terraform v0.6.1

@semarj
Copy link

semarj commented Sep 3, 2015

"forces new resource" means that it is going to have to delete the resource that had this attribute change and recreate it. I agree that it is confusing that the Plan: line doesn't match up to the Resources: line.

@apparentlymart
Copy link
Contributor

Yeah, it looks like the bug is that the plan summary doesn't correctly handle the "forces new resource" items.

From looking at the code it seems like this is being done intentionally, by adding together the count that will be modified and the count that will be replaced. It looks like this would be a pretty easy change to make it behave more like the apply summary, assuming there isn't a good reason why it's the way it is now.

@ghost
Copy link

ghost commented May 1, 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 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.

@ghost ghost locked and limited conversation to collaborators May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants