Master the complete Terraform workflow including making changes, destroying resources, and understanding the plan output.
Create a simple configuration that we'll modify throughout this lesson.
mkdir -p ~/terraform-practice/lesson-104cd ~/terraform-practice/lesson-104cat > main.tf << 'EOF'
terraform {
required_providers {
local = {
source = "hashicorp/local"
version = "~> 2.4"
}
}
}
resource "local_file" "example" {
filename = "${path.module}/example.txt"
content = "Version 1: Original content"
}
resource "local_file" "backup" {
filename = "${path.module}/backup.txt"
content = "Backup file content"
}
EOFWe're creating two simple files that we can modify and destroy to see how Terraform handles changes.
A main.tf file with two local_file resources.