terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Can "terraform plan" and "terraform apply" have an option to not show the sentinel policies

Open scott-doyland-burrows opened this issue 1 year ago • 4 comments

Terraform Version

Terraform v1.9.8
on linux_amd64
+ provider registry.terraform.io/hashicorp/tfe v0.60.0

Use Cases

When I run a plan or apply locally against a remote execution workspace, I see the sentinel policies.

I have to scroll up a few pages to see the actual plan output.

Attempted Solutions

terraform plan -var-file=tfvars/workspaces.tfvars | sed /^-----/q

This will prevent the sentinel policies from showing - but it is a pain to type it

Proposal

terraform plan -var-file=tfvars/workspaces.tfvars -show-sentinel=false

or

export TF_SHOW_SENTINEL=false

References

No response

scott-doyland-burrows avatar Nov 14 '24 16:11 scott-doyland-burrows

Hi @scott-doyland-burrows,

Terraform doesn't run sentinel or know anything about its policies, so there's not really any way for it to control the output.

I'm guessing you are using the cloud backend, and executing the plan remotely? If that's the case then it probably needs to be an Cloud/TFE feature to deal with the option, since Terraform is essentially only echoing the remote process's output.

jbardin avatar Nov 14 '24 23:11 jbardin

Yes, I am using the cloud backend.

I'll try and find out where to raise terraform cloud feature requests.

scott-doyland-burrows avatar Nov 15 '24 18:11 scott-doyland-burrows

@scott-doyland-burrows you can find all of that information in our bug report template!

https://github.com/hashicorp/terraform/issues/new?assignees=&labels=bug%2Cnew&projects=&template=bug_report.yml

The relevant information is:

HCP Terraform or Terraform Enterprise: please email [email protected] or open a new request.

crw avatar Nov 18 '24 18:11 crw

I was hoping there was a terraform flag for this one workaround for this: terraform plan | sed '/Organization policy check/q' the policies are still gonna be checked but the output will not bloat the console

alex529 avatar Oct 16 '25 12:10 alex529