terraform,

Warning: Redundant ignore_changes element in Terraform

Jun 17, 2022 · 1 min read · Post a comment

Besides some new cool features introduced in Terraform v1.2.0 like precondition and postcondition check blocks – a new warning message was part of the release as well. While I was trying to deploy something, I received the following warning in the console:

╷
│ Warning: Redundant ignore_changes element
│
│   on s3.tf line 150, in resource "aws_s3_bucket" "devcoops":
│    150: resource "aws_s3_bucket" "devcoops" {
│
│ 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 acl 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.
╵

Prerequisites

  • Terraform

Solution(s)

ignore_changes can be defined in a TF resource block and as the name implies, all resource attributes that are part of it, will be ignored in the next planning updates. Since the warning was descriptive enough, all I had to do is remove the acl attribute thus removing the warning message on the following terraform plan.

So, whatever your case might be, make sure to read it first and understand which resource attribute is causing the warning in the first place.

Conclusion

If you have any related unresolved issues, feel free to share them in the comment section below. On a side note, follow our official channel on Telegram.