Hands-on exercises “First Apply”
Exercise
Goal: Learn the Terraform workflow by creating and inspecting a local file resource.
Steps: Follow these steps:
- Create a new folder.
- Switch to the new folder.
-
Create
main.tfwith the following content:resource "local_file" "foo" { content = "foo!" filename = "${path.module}/foo.bar" file_permission = "0644" } -
Run the Terraform workflow:
terraform init terraform plan terraform apply terraform output terraform plan
The final plan should report no changes. The resource is already in the desired state.