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

s3_bucket_object diffs didn't match, when ignore_changes lifecycle rule is in place #5369

Closed
hanninen opened this issue Feb 29, 2016 · 2 comments

Comments

@hanninen
Copy link
Contributor

The s3_bucket_object resource's diffs didn't match, when I added the ignore_changes lifecycle rule to the resource. The s3 object is defined in a module that is used in the terraform root module.

My working resource configuration

resource "aws_s3_bucket_object" "logstash-config" {
    bucket = "${aws_s3_bucket.ecs.id}"
    key = "logstash.config"
    source = "${path.module}/files/aws_s3_bucket_object.logstash.config"
}

terraform apply fails with this resource configuration

resource "aws_s3_bucket_object" "logstash-config" {
    bucket = "${aws_s3_bucket.ecs.id}"
    key = "logstash.config"
    source = "${path.module}/files/aws_s3_bucket_object.logstash.config"
    lifecycle { ignore_changes = ["source"] }
}

We are using a custom wrapper for terraform, which initializes the terraform environment in a clean temporary directory, thus causing the source value to change on each run.

Here is the error output from terraform apply:

* aws_s3_bucket_object.logstash-config: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

Please include the following information in your report:

    Terraform Version: 0.6.12
    Resource ID: aws_s3_bucket_object.logstash-config
    Mismatch reason: diff RequiresNew; old: false, new: true
    Diff One (usually from plan): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{"key":*terraform.ResourceAttrDiff{Old:"logstash.config", New:"logstash.config", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "etag":*terraform.ResourceAttrDiff{Old:"\"8bf09728676947c03e069eaddc9ca391\"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "bucket":*terraform.ResourceAttrDiff{Old:"infra-ecs-test", New:"infra-ecs-test", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "content_type":*terraform.ResourceAttrDiff{Old:"binary/octet-stream", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}}, Destroy:false, DestroyTainted:false}
    Diff Two (usually from apply): *terraform.InstanceDiff{Attributes:map[string]*terraform.ResourceAttrDiff{"etag":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Type:0x0}, "bucket":*terraform.ResourceAttrDiff{Old:"", New:"infra-ecs-test", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "content_type":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}, "key":*terraform.ResourceAttrDiff{Old:"", New:"logstash.config", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0}}, Destroy:false, DestroyTainted:false}

Also include as much context as you can about your config, state, and the steps you performed to trigger this error.
@phinze
Copy link
Contributor

phinze commented Mar 14, 2016

Hi @hanninen - thanks for this report, I'm working on fixing up all known issues with ignore_changes today. Consolidating this issue over into #5627 👍

@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

3 participants