no-terraform-data-condition
Disallow lifecycle conditions attached to terraform_data guard resources.
Why
A terraform_data resource created only to reject a plan turns configuration policy into stateful graph noise. The assertion drifts with today's configuration while obscuring the input, resource, test, or deployment boundary that owns the invariant.
Fix
Identify the invariant and its authoritative owner. Establish equivalent admission and rollback protection before reviewed removal; do not relocate it into another prohibited variable validation, check or lifecycle guard. Preserve resource addresses and substantive safeguards.
Examples
resource "terraform_data" "guard" { lifecycle { precondition { condition = true error_message = "Always passes." } }}resource "terraform_data" "guard" { lifecycle {}}Autofix output
resource "terraform_data" "guard" { lifecycle {
}}resource "terraform_data" "deployment_guard" { lifecycle { precondition { condition = var.enabled error_message = "deployment must be enabled" } }}resource "terraform_data" "bootstrap" { triggers_replace = [var.release] provisioner "local-exec" { command = "bootstrap-hosts" } lifecycle { precondition { condition = var.release != "" error_message = "A release is required for provisioning." } }}