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

Allow selecting attribute of all elements of a collection in ignore_changes #29394

Open
jhyot opened this issue Aug 17, 2021 · 1 comment
Open

Comments

@jhyot
Copy link

jhyot commented Aug 17, 2021

I could not get ignore_changes to work with a property of a nested list of blocks in Terraform 1.0.

In this example I would like to ignore any prop_b changes in any example_block:

resource "example_resource" {
  example_block {
    prop_a = "abc"
    prop_b = "123"
  }

  example_block {
    prop_a = "xyz"
    prop_b = "999"
  }

  lifecycle {
    ignore_changes = [
    // -------- what to put here? ---------
    ]
  }
}

Searching on the internet there are many suggestions, but none of them seem to work, including:

  • "example_block.%.prop_b" --> Error: "Dot must be followed by attribute name."
  • example_block[*].prop_b --> Error: "A single static variable reference is required"
  • example_block.0.prop_b --> Ignores it for the first item, but not "all" items
  • example_block[0].prop_b --> Seems to be same as above
  • example_block["prop_b"] --> Seems to ignore the whole example_block, in particular adding a new example_block does not add it in the Terraform plan.
@jhyot jhyot added enhancement new new issue not yet triaged labels Aug 17, 2021
@jbardin jbardin added config and removed new new issue not yet triaged labels Aug 17, 2021
@jbardin jbardin changed the title ignore_changes should support sub-properties of nested block lists support splat expression in ignore_changes Aug 17, 2021
@jbardin jbardin changed the title support splat expression in ignore_changes support splat expressions in ignore_changes Aug 17, 2021
@apparentlymart apparentlymart changed the title support splat expressions in ignore_changes Allow selecting attribute of all elements of a collection in ignore_changes Aug 23, 2021
@andyli
Copy link

andyli commented Aug 27, 2021

looks like a duplicate of #5666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants