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 compatibility with TF version 1.2 #401

Closed
1 task done
pat-s opened this issue May 20, 2022 · 6 comments · Fixed by #420
Closed
1 task done

ignore_changes compatibility with TF version 1.2 #401

pat-s opened this issue May 20, 2022 · 6 comments · Fixed by #420

Comments

@pat-s
Copy link

pat-s commented May 20, 2022

Description

TF 1.2 has implemented a change WRT to the handling of ignore_changes, see here.

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

Versions

  • Module version [Required]:

4.3.0

  • Terraform version:
Terraform v1.2.0
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v4.12.1
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/googleworkspace v0.6.0
+ provider registry.terraform.io/hashicorp/helm v2.5.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.11.0
+ provider registry.terraform.io/hashicorp/local v2.2.2
+ provider registry.terraform.io/hashicorp/random v3.1.3
+ provider registry.terraform.io/hashicorp/vault v3.5.0
+ provider registry.terraform.io/terraform-aws-modules/http v2.4.1
  • Provider version(s):

Reproduction Code [Required]

Steps to reproduce the behavior:

  1. Execute any TF code which uses the model terraform-aws-modules/rds/aws with TF 1.2

Expected behavior

No warning is being issued.

Actual behavior

╷
│ Warning: Redundant ignore_changes element
│ 
│   on .terraform/modules/postgres.postgres/modules/db_instance/main.tf line 26, in resource "aws_db_instance" "this":
│   26: resource "aws_db_instance" "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 latest_restorable_time 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.

Terminal Output Screenshot(s)

Additional context

AFAICS the following part could/should be removed in main.tf:
https://github.com/terraform-aws-modules/terraform-aws-rds/blob/master/modules/db_instance/main.tf#L120-L124

cc @wael-sadek @mbannert

@antonbabenko
Copy link
Member

I believe that this behavior should have been a feature flag in Terraform 1.2 which can be optionally disabled by some users who don't want to see warnings like this.

Currently, we don't have to increase the minimum version of Terraform required for this module because we don't use features introduced in the recent versions.

I don't think we will have a way to fix such warnings in the modules also because we can't use variables inside of ignore_changes block and users of Terraform <1.2 don't have such an issue.

@pat-s
Copy link
Author

pat-s commented May 20, 2022

Sure, fully understand! Just wanted to write down this "issue" so that others can possibly find it (and also your reply to it) 🙂

@michelzanini
Copy link

If you were to remove the ignore_changes previous versions of Terraform would not break but start displaying a block of "Changes made outside Terraform". That is not nice, but it's less critical than a warning that happens on 1.2.

That way I think the best compromise is to leave the "Changes made outside Terraform" for previous versions and no warnings on most recent versions, since the future is 1.2+ anyway.

@antonbabenko antonbabenko mentioned this issue Jun 8, 2022
3 tasks
@michelzanini
Copy link

Can we do the same as the EKS module?
terraform-aws-modules/terraform-aws-eks#2114

@antonbabenko
Copy link
Member

This issue has been resolved in version 5.0.0 🎉

@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 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants