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

ignore_changes does not properly filter ForceNew attributes from diff #3528

Closed
vitroth opened this issue Oct 16, 2015 · 6 comments
Closed

ignore_changes does not properly filter ForceNew attributes from diff #3528

vitroth opened this issue Oct 16, 2015 · 6 comments

Comments

@vitroth
Copy link

vitroth commented Oct 16, 2015

Testing the new ignore_updates feature (which I'm excited to have), I've encountered two problems immediately.

On existing EC2 instances provisioned with 0.6.3, setting the ignore_updates to ["ami", "user_data"] and then changing the user_data, terraform 0.6.4 still wants to delete & recreate the instances.

Additionally, with ignore_updates set to either that or just ["ami"], instance creation fails with:
aws_instance.foo: diffs didn't match during apply. This is a bug with Terraform and should be reported

@phinze
Copy link
Contributor

phinze commented Mar 1, 2016

This should be working now on the latest version of Terraform - feel free to follow up if you see trouble!

@phinze phinze closed this as completed Mar 1, 2016
@vitroth
Copy link
Author

vitroth commented Mar 1, 2016

I just tested with 0.6.12 and ignoring an AMI change still doesn't work. For every aws_instance resource I added:

  lifecycle {
    # Once created, ignore future changes to the ami
    ignore_changes = ["ami"]
  }

But on a terraform plan I see:

-/+ module.apcera-aws.aws_instance.singleton
    associate_public_ip_address: "true" => "1"
    availability_zone:           "us-west-2a" => "<computed>"
    ebs_block_device.#:          "0" => "<computed>"
    ephemeral_block_device.#:    "0" => "<computed>"
    instance_state:              "running" => "<computed>"
    instance_type:               "m1.small" => "m1.small"
    key_name:                    "aws-eng-usw2-201510" => "aws-eng-usw2-201510"
    placement_group:             "" => "<computed>"
    private_dns:                 "ip-10-0-0-206.us-west-2.compute.internal" => "<computed>"
    private_ip:                  "10.0.0.206" => "<computed>"
    public_dns:                  "" => "<computed>"
    public_ip:                   "REDACTED" => "<computed>"
    root_block_device.#:         "1" => "<computed>"
    security_groups.#:           "1" => "1"
    security_groups.2859541123:  "sg-9f910bfb" => "sg-9f910bfb"
    source_dest_check:           "true" => "1"
    subnet_id:                   "subnet-02e6b867" => "subnet-02e6b867"
    tags.#:                      "1" => "1"
    tags.Name:                   "foo-singleton" => "foo-singleton"
    tenancy:                     "default" => "<computed>"
    user_data:                   "676807870701f2763666ebae7af918b55fd86d66" => "676807870701f2763666ebae7af918b55fd86d66"
    vpc_security_group_ids.#:    "1" => "<computed>"

(Note no row highlighted as the "forces new resource")

@phinze
Copy link
Contributor

phinze commented Mar 1, 2016

Thanks for re-testing @vitroth - looks like ForceNew attributes aren't being properly handled. Reopening and we'll get this fixed up.

@nickithewatt
Copy link
Contributor

@phinze I can confirm that this is still an issue with 0.6.12. I created a separate issue (#5294) which can probably be closed, and simply tracked here now. To recap, that issue is specifically around ignore_changes not working in relation to the AWS user_data variable, where the content is coming from a rendered template.

@phinze phinze changed the title 0.6.4 feature 'ignore_updates' doesn't work for AWS ami and user_data ignore_changes does not properly filter ForceNew attributes from diff Mar 3, 2016
@phinze phinze added core and removed provider/aws labels Mar 3, 2016
@phinze
Copy link
Contributor

phinze commented Mar 14, 2016

Hey folks, rolling up ignore_changes problems in #5627 and tackling fixes today. Head over 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