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 warning with Terraform v1.2.0 #2081

Closed
1 task done
mikemurray86 opened this issue May 19, 2022 · 12 comments · Fixed by #2114
Closed
1 task done

ignore_changes warning with Terraform v1.2.0 #2081

mikemurray86 opened this issue May 19, 2022 · 12 comments · Fixed by #2114

Comments

@mikemurray86
Copy link

Description

When a plan or an apply is perfomred with terraform version 1.2.0 a warning is presented about a redundant ignore_changes element. Any example from the examples/* can be used to reproduce the error message with the correct version of terraform.

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 18.21.0 & 18.20.5

  • Terraform & Provider versions:
    Terraform v1.2.0
    on darwin_amd64
    + provider registry.terraform.io/hashicorp/aws v4.12.1
    + provider registry.terraform.io/hashicorp/cloudinit v2.2.0
    + provider registry.terraform.io/hashicorp/helm v2.5.1
    + provider registry.terraform.io/hashicorp/kubernetes v2.11.0
    + provider registry.terraform.io/hashicorp/tls v3.3.0

Reproduction Code [Required]

Any code in the examples will exibit this behavior.

Steps to reproduce the behavior:

initialize and plan any configuration using this module.

Expected behavior

a plan/apply that does not present a warning message

Actual behavior

while all actions are still successful a warning message is presented about a Redundant ignore_changes element

Terminal Output Screenshot(s)

image

Additional context

the changelog for terraform 1.2.0 mentions this new warning message will be presented going forward.

@bryantbiggs
Copy link
Member

We will have to investigate this further

@sanarena
Copy link

Is this a tricky one? removing modifed_at from ignore_changes is not enough?

@antonbabenko
Copy link
Member

@sanarena Unfortunately, it is not enough because it will be different behavior for users using previous versions of Terraform (<1.2).

The problem is that currently, we don't know how to make the same code work for both Terraform ranges: >= 1.2 and < 1.2.

@sklirg
Copy link

sklirg commented May 30, 2022

Terraform output (v1.2.1) claims that the statement has no effect, though, or is that incorrect?

│ Warning: Redundant ignore_changes element

│ on .terraform/modules/eks.eks/main.tf line 305, in resource "aws_eks_addon" "this":
│ 305: resource "aws_eks_addon" "this" {

│ Adding an attribute name to ignore_changes tells Terraform to ignore future changes to the argument in configuration after the object has
│ been created, retaining the value originally configured.

│ The attribute modified_at is decided by the provider alone and therefore there can be no configured value to compare with. Including this
│ attribute in ignore_changes has no effect
. Remove the attribute from ignore_changes to quiet this warning.

@bryantbiggs
Copy link
Member

We will incorporate this change in v19.x

@ShonL
Copy link

ShonL commented Jun 9, 2022

@bryantbiggs is it meaning that 19.x will require Terraform version to be 1.2 and above?

@bryantbiggs
Copy link
Member

bryantbiggs commented Jun 9, 2022

Possibly - we'll have to weight the considerations. With 1.3 now supporting variable optional type constraints, that is something that we've been waiting for to help satisfy the feedback we've heard around the use of variables with type any and how users need to go and find what that variable data shape looks like. However, that means that we're potentially blocking out a large portion of our user base who may not be able to upgrade to 1.3 for sometime. So its a challenge that we have to weigh the pros and cons and understand if the benefits outweigh the costs and how we can provide the best possible module while still serving as many users as possible. I am open to suggestions if there are any

@kuboraam
Copy link

@bryantbiggs is there a way to check terraform version in the code and modify the ignore_changes this only if version >=1.2 or is that too dirty? this can be done temporarily i guess, until eventually everyone upgrades to 1.3 and we can apply a permanent "fix" in future releases of the module.

@bryantbiggs
Copy link
Member

@bryantbiggs is there a way to check terraform version in the code and modify the ignore_changes this only if version >=1.2 or is that too dirty? this can be done temporarily i guess, until eventually everyone upgrades to 1.3 and we can apply a permanent "fix" in future releases of the module.

Unfortunately, no. There isn't any dynamic routes that I know of that would support this

@bryantbiggs bryantbiggs added this to the v19.0.0 milestone Jun 18, 2022
@bryantbiggs bryantbiggs removed this from the v19.0.0 milestone Jun 18, 2022
@bryantbiggs
Copy link
Member

After thinking about this a bit more, I think we can accommodate a change for this. PR is coming

@antonbabenko
Copy link
Member

This issue has been resolved in version 18.24.1 🎉

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants