Outputs Explained

In this lesson, you'll learn how to write an output in Terraform, how they work, and how they are defined.

Terraform project output

Output in your Terraform project shows a piece of data after Terraform successfully completes. Outputs are useful as they allow you to echo values from the Terraform run to the command line. For example, if you are creating an environment and setting up a bastion jump box as part of that environment, it’s handy to be able to echo the public IP address of the newly created bastion to the command line. Then, after the terraform apply finishes, you are given the IP of the newly created bastion which is ready for you to ssh straight onto it.

Get hands-on with 1200+ tech skills courses.