Terraform Hello World and First Step

The smallest Terraform flow: provider, resource, init, plan, apply, and destroy.

What "hello world" means in Terraform

A Terraform hello world is not about printing text. It is about declaring one very small piece of infrastructure and letting Terraform create it for you.

Your first step is usually a tiny configuration with one provider and one resource. The goal is to understand the lifecycle, not to build something impressive.

Think in declarations: you describe the desired end state, and Terraform calculates the operations needed to reach it.

Minimal flow

  1. Create a folder for the project.
  2. Add a main.tf file.
  3. Declare the provider and one resource.
  4. Run terraform init to install provider plugins.
  5. Run terraform plan to preview changes.
  6. Run terraform apply to create the resource.

After you verify the result, run terraform destroy to remove the resource and keep the environment clean.

terraform init
terraform plan
terraform apply
terraform destroy

Why the first step matters

This first exercise teaches three important habits: keep configuration in version control, read the plan before you apply, and destroy test infrastructure when you no longer need it.

Those habits scale from a single storage account to a full production platform.