Terraform: Zero to Confident
0%
terraform-lab, bash
Welcome to the DevOpsLesson Terraform Lab 🟣
This is a safe, simulated Terraform environment. Nothing real is provisioned.
Follow the steps on the left. Type a command below, or type 'help' anytime.
Every command this lab teaches
Terraform: Zero to Confident is 11 steps, about 25 minutes. Each one asks a question, you type the answer in the terminal above, and it is checked before you move on. Nothing is installed and nothing can break.
Beginner5 steps
- Print the installed Terraform version.
terraform version - Create a main.tf file that declares one resource.
echo 'resource "local_file" "hello" { filename = "hello.txt" content = "Hello, Terraform!" }' > main.tf - Initialize the working directory.
terraform init - Rewrite the configuration files into canonical style.
terraform fmt - Validate the configuration.
terraform validate
Intermediate3 steps
- Generate an execution plan.
terraform plan - Apply the configuration to create your resource.
terraform apply -auto-approve - List the resources recorded in state.
terraform state list
Advanced3 steps
- Add an output block, then apply again so it is computed.
echo 'output "file_path" { value = local_file.hello.filename }' >> main.tf - Show the output values from state.
terraform output - Destroy all managed resources.
terraform destroy -auto-approve