Lesson 2 of 4 ยท Introduction to Terraform
Your first Terraform workflow
A normal Terraform workflow is deliberately cautious. You initialise a project, check whether the configuration is valid, preview its changes, and only then apply them. The preview is your chance to catch surprises before your cloud account changes.
Example
terraform init # Download the provider
terraform validate # Check configuration structure
terraform plan # Preview changes
terraform apply # Confirm and create changesStep by step
- Create an empty folder and add a file called main.tf.
- Run terraform init once after adding or changing providers.
- Run validate and plan whenever you make a change.
- Use apply only after reviewing the plan.
Common mistakes to avoid
- Running apply without reading the plan.
- Committing .terraform or sensitive state files to source control.