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 15 / 37

Inspecting One Resource with terraform state show

When you need the full detail of a single resource, use terraform state show. It prints every recorded attribute of that one address.

The syntax is terraform state show address.

Running terraform state show aws_instance.web prints that instance's ID, type, IP addresses, tags and everything else Terraform holds about it.

A common stumble is guessing the address. Get it from state list rather than typing what you think it should be.

In real work, it is the quickest way to answer "what IP did that instance actually get?" without opening the cloud console.

Terraform
Try it (type this into the pseudo terminal)
terraform state show aws_instance.web

🧑‍💻 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)