← Lessons/Your First Resource
← Your First Resource

Apply and create it

Learn

Apply: make it real

apply carries out the plan. Terraform creates the server, then records it in state:

demo_server.web: Creating...
demo_server.web: Creation complete

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Open the State Inspector afterwards. The resource is there with every attribute, including the computed ones the plan couldn't show: a real id (like demo_server-977a3db6) and a private_ip.

That record is how Terraform connects the demo_server.web in your code to the real server it created. Without it, the next run couldn't tell "this server is mine and already exists" from "this server still needs creating".

Switch to apply and run it. Terraform creates the server and records it in state — open the State Inspector to see it.

Loading...

State Inspector

State

Terraform's memory

empty — nothing here yet

Real Infrastructure

the actual world

empty — nothing here yet