Ad space (banner)
AD

Got the fundamentals? A structured Terraform course is a fast way to level up.

Find Terraform courses on Udemy

Affiliate link. Costs you nothing extra.

Lesson 18 / 37

Reading Outputs with terraform output

When you want the values your configuration exposes, use terraform output. It prints the defined outputs.

The syntax is terraform output, or terraform output name for one specific value.

Running it prints each output and its value, such as instance_public_ip = "203.0.113.10".

A common stumble is trying to read outputs before the first apply. They only exist once the resources behind them do.

In real work, scripts call terraform output -raw name to feed a value straight into the next step of a deployment.

Terraform
Try it (type this into the pseudo terminal)
terraform output

🧑‍💻 You can type this command into the Terraform pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)