Terraform: Terraform apply output variables [feature request]

Created on 1 Nov 2017  ยท  3Comments  ยท  Source: hashicorp/terraform

I would like to suggest a new feature -output=path to redirect to file or possibly completely hide the output variables which are printed out when terraform apply command has finished.

The idea behind it is that some of the data which is printed out in the output variables is sensitive like AWS keys, RDS password and so on, and i don't want it to be shown or written out to a file.
I'm running the terraform apply from the CI system and i don't want it to printout all the sensitive data to the build output but keep it private, on the other hand i do want to printout the changed that were made during the apply command.

If someone has an alternative approach to hiding that data, i'm happy to hear.

Most helpful comment

Hi @kobymeir!

Terraform supports an argument sensitive for an output, which prevents it from being shown in the clear in the console output:

output "example" {
  value     = "..."
  sensitive = true
}

This can be set optionally for each output so you can have a mixture of both sensitive and safe outputs.

I think this will achieve your goals here, though please let me know if I've missed something!


For running Terraform in a CI system you may find our guide _Running Terraform in Automation_ useful. It's not directly about your question here but contains some other tips about suggested ways to run Terraform in non-interactive automation environments.

All 3 comments

Hi @kobymeir!

Terraform supports an argument sensitive for an output, which prevents it from being shown in the clear in the console output:

output "example" {
  value     = "..."
  sensitive = true
}

This can be set optionally for each output so you can have a mixture of both sensitive and safe outputs.

I think this will achieve your goals here, though please let me know if I've missed something!


For running Terraform in a CI system you may find our guide _Running Terraform in Automation_ useful. It's not directly about your question here but contains some other tips about suggested ways to run Terraform in non-interactive automation environments.

@apparentlymart that will work for me.
Also thanks for the automation reference link

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings