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

Issue with changing aws_instance and "diffs didn't match during apply" #3738

Closed
colinmutter opened this issue Nov 3, 2015 · 3 comments
Closed

Comments

@colinmutter
Copy link

After changing the user_data on an aws_instance resource, and subsequently adding ignore_changes = ["user_data"], the resource was forced to be created (another problem in itself) but once it was deleted it would fail to re-create with error:

2015/11/03 13:55:55 [ERROR] aws_instance.test: diffs didn't match
2015/11/03 13:55:55 [ERROR] aws_instance.test: reason: extra attributes: user_data
2015/11/03 13:55:55 [ERROR] root: eval: *terraform.EvalCompareDiff, err: aws_instance.test: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2015/11/03 13:55:55 [ERROR] root: eval: *terraform.EvalSequence, err: aws_instance.test: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2015/11/03 13:55:55 [ERROR] root: eval: *terraform.EvalOpFilter, err: aws_instance.test: diffs didn't match during apply. This is a bug with Terraform and should be reported.
2015/11/03 13:55:55 [ERROR] root: eval: *terraform.EvalSequence, err: aws_instance.test: diffs didn't match during apply. This is a bug with Terraform and should be reported.

Repeated attempts to terraform plan would show the creation of a new resource:

+ aws_instance.test
    ami:                               "" => "ami-123456"
    source_dest_check:                 "" => "1"
    subnet_id:                         "" => "subnet-123456"
    tags.#:                            "" => "4"
    ... bits removed for security ...
    user_data:                         "" => "hash-here"

But running it would produce the same error.

* aws_instance.test: diffs didn't match during apply. This is a bug with Terraform and should be reported.

Once this lifecycle clause was removed from the config...

  lifecycle {
    ignore_changes = ["user_data"]
  }

The resources were created just fine. The big problem here is that we need to be able to ignore changes on attributes like user_data without causing the tfstate to be corrupted (er, out of sync).

@pdecat
Copy link
Contributor

pdecat commented Jan 11, 2016

Got the same issue: commenting the lifecycle { ignore_changes = ["user_data"] } directive during instance creation worked.

Thanks @colinmutter!

Edit: FWIW, the workaround also applies to VPC creation with a lifecycle { ignore_changes = ["tags"] } directive.

@phinze
Copy link
Contributor

phinze commented Mar 14, 2016

Hi folks, rolling up ignore_changes problems into #5627 and tackling fixes today. Head there for updates!

@phinze phinze closed this as completed Mar 14, 2016
@ghost
Copy link

ghost commented Apr 27, 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 Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants