Skip to content

terraform show PLANFILE does not include warnings #35885

@RachaelSTamakloe

Description

@RachaelSTamakloe

Terraform Version

$ terraform -version
Terraform v1.9.8
on linux_amd64

Terraform Configuration Files

-Actual Context: GoogleCloudPlatform/cluster-toolkit#3131

Simpler config file for reproducibility:
In main.tf:

resource "google_compute_instance" "default" {
  name         = "test"
  machine_type = "n1-standard-1"
  zone         = "us-central1-a"
  project = "dev-pool-prj8"

  tags = ["foo", "bar"]

  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-9"
    }
  }

  // Local SSD disk
  scratch_disk {
    interface = "SCSI"
  }

  network_interface {
    network = "default"
    

    access_config {
      // Ephemeral IP
    }
  }
}

# Check block outside the resource
check "instance_name_valid" {
  assert {
    condition = google_compute_instance.default.name != "test"
    error_message = "Instance name cannot be 'test'."
  }
}

Debug Output

https://gist.github.com/RachaelSTamakloe/9efdca0181602474c5657f00a25e4fbd

Expected Behavior

I expect the warning messages displayed in "terraform plan" to also be present in "terraform show PLANFILE," after it has been saved using "terraform plan -out PLANFILE"

Actual Behavior

"terraform show PLANFILE" fails to include warnings that are present in the output of terraform plan. When the output of terraform plan -out is saved in a PLANFILE and shown using "terraform show", warning messages that are originally present in terraform plan are not displayed in "terraform show PLANFILE".

Steps to Reproduce

  1. terraform init
  2. terraform plan -out my.tfplan
  3. terraform show my.tfplan

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions