Upgrade from 0.14 to 0.15 - ignore_changes not working anymore

I am trying to upgrade our deploy stack from 0.14 to 0.15. I am running terraform plan to check there will be no issues but am seeing changes for resources I have marked with ‘ignore_changes’.

We are using aws provider 2.66.0 which is pretty old. I was going to upgrade than after I reach 0.15 terraform.

For example I have the following config for an ecs service.

resource "aws_ecs_service" "web" {
  lifecycle {
    ignore_changes = [
      task_definition,
      load_balancer
    ]
  }

But when running terraform plan it shows me the following output. (I have replaced any sensitive values with dummy data)

#aws_ecs_service.web has been changed
  ~ resource "aws_ecs_service" "web" {
        id                                 = "arn:aws:ecs:ap-southeast-2:222222222:service/stage1-blah-ecs-cluster/ecs-blah-web"
        name                               = "ecs-blah-web"
        tags                               = {}
      ~ task_definition                    = "arn:aws:ecs:ap-southeast-2:222222222:task-definition/stage1-blah-web-td:746" -> "arn:aws:ecs:ap-southeast-2:222222222:task-definition/stage1-blah-web-td:747"
        # (10 unchanged attributes hidden)


      - load_balancer {
          - container_name   = "blah" -> null
          - container_port   = 8000 -> null
          - target_group_arn = "arn:aws:elasticloadbalancing:ap-southeast-2:222222222:targetgroup/stage1-blah-web-1/83bcf851e4f3c389" -> null
        }
      + load_balancer {
          + container_name   = "blah"
          + container_port   = 8000
          + target_group_arn = "arn:aws:elasticloadbalancing:ap-southeast-2:222222222:targetgroup/stage1-blah-web-2/6cc09439bf754dfd"
        }
        # (1 unchanged block hidden)
    }

It tells me it is going to change these resources. So I don’t think it is just informative about what has changed even though it will be ignored by terraform. (I read that in another thread)


**Plan:** 0 to add, 9 to change, 0 to destroy.

Oh hang on. I feel stupid now. it is very hard to make sense of the output. There is another section below the informative section about changes made that might be ignored. It looks like the 9 that will be changed are different resources.
I wish I could delete this thread now.

Is there a way to turn off this noisy output? It makes the job of upgrading much more difficult.

**Note:** **Objects have changed outside of Terraform**

Hi @carl1,

As I think you’ve seen from the subsequent comments here, ignore_changes is to tell Terraform to ignore changes you make inside the configuration, but not to ignore changes outside of Terraform. There is no way to ignore changes outside of Terraform because providers depend on Terraform accurately reporting the most recent state of an object in order to produce accurate plans.

However, in the forthcoming v1.2.0 release (in release candidate at the time I’m writing this) there are some refinements to the logic which detects changes outside of Terraform so it should be better able to filter out changes outside of Terraform that don’t seem to be the cause of changes proposed by Terraform.

Since you are already using Terraform v0.14 there is no need to upgrade only to v0.15; everything from v0.15 onwards is skip-over-able so you can jump directly to the latest v1.1 release today, and to the new v1.2.x series once it’s final, as long as you review the upgrade guides to see if any of the rare situation upgrade notes apply to you. Therefore I would suggest upgrading directly to the latest v1.1.x release now and then adopting a v1.2 release soon after that series is final, at which point I expect you’ll see better behavior for the objects changed outside of Terraform detection.

1 Like