Terraform continuously detects drift on an S3 bucket's `tags` attribute set by an external process, causing noisy plans. How do you suppress this without removing the attribute?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Add `tags` to `ignore_changes` in the resource's `lifecycle` block

`ignore_changes = [tags]` instructs Terraform to ignore differences in the `tags` attribute during planning. Terraform will still manage all other attributes. This is the correct p...

Real Exam Scenario

Terraform continuously detects drift on an S3 bucket's `tags` attribute set by an external process, causing noisy plans. How do you suppress this without removing the attribute?

✓ Correct Answer & Explanation

Correct Answer

Add `tags` to `ignore_changes` in the resource's `lifecycle` block

Why This Answer Is Correct

`ignore_changes = [tags]` instructs Terraform to ignore differences in the `tags` attribute during planning. Terraform will still manage all other attributes. This is the correct pattern when an external system (e.g., a tagging tool or AWS Config rule) manages certain attributes. It does NOT prevent Terraform from setting tags on resource creation — it only ignores subsequent drift.