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

Changes not being ignored with ignore_changes set #18641

Closed
syphernl opened this issue Aug 9, 2018 · 3 comments
Closed

Changes not being ignored with ignore_changes set #18641

syphernl opened this issue Aug 9, 2018 · 3 comments

Comments

@syphernl
Copy link

syphernl commented Aug 9, 2018

Terraform Version

Terraform v0.11.7
+ provider.aws v1.28.0
+ provider.random v1.3.1

Terraform Configuration Files

resource "aws_instance" "acceptance_web01" {
  ami                           = "ami-yadayada"
  instance_type                 = "t2.small"
  availability_zone             = "eu-west-1a"
  key_name                      = "mykey"
  disable_api_termination       = true

  lifecycle {
    prevent_destroy             = true
    ignore_changes              = ["ami", "instance_type"]
  }
}

Expected Behavior

The change to the AMI should be ignored.

Actual Behavior

If the AMI changes:

With prevent_destroy set to true it reports:

The plan would destroy this resource, but it currently has lifecycle.prevent_destroy set to true. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or adjust the scope of the plan using the -target flag.

With prevent_destroy set to false (or removed) it wants to remove (and recreate) the instance if the AMI changes

References

These appear to be related:

@radeksimko radeksimko added the bug label Aug 13, 2018
@BlaineAtAffirm
Copy link

Just noting that this also happens when user data changes. So I guess ignore_changes is not implemented for the aws_instance resource in general. Also, would this issue be more quickly addressed in the https://github.com/terraform-providers/terraform-provider-aws repo ?

@hashibot
Copy link
Contributor

Hello! 🤖

This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it.

If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform.

Thanks!

@ghost
Copy link

ghost commented Sep 27, 2019

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 Sep 27, 2019
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