HashiCorp Terraform output values export data about your infrastructure resources, like IP addresses, regions, and more. You can use this data to configure other parts of your infrastructure with automation tools, or as a data source for another Terraform workspace. Outputs are also necessary to import data from child modules into your root module.
Follow our new tutorial, Output Data From Terraform, to use Terraofrm outputs with real infrastructure. Here are some of the highlights of what you’ll learn.
Below is a code example showing how you define output blocks to export structured data from your Terraform configuration.
When you apply this configuration, Terraform will print out these values to the command line. You can also use outputs to connect Terraform configuration, either through the use of modules, or separate workspaces.
Sometimes you need to share data between Terraform modules or workspaces that includes sensitive information such as usernames and passwords. Terraform outputs support the
sensitive flag, which will redact these values in console output and log messages.
When Terraform prints out these values, it will redact them as
Try the new hands-on tutorial: Output Data From Terraform.
Terraform Enterprise enhances observability and cuts operational burden with improved run metrics, identity-based storage authentication, and versioned documentation.
Now generally available, HashiCorp Terraform 1.3 introduces optional object type attributes with defaults, and enhancements to moved blocks, improving extensibility and maintainability of Terraform modules.
Drift detection is essential to maintaining efficiency while minimizing risk and giving teams confidence in your infrastructure as code (IaC) provisioning workflow.