learn-terraform

Course outlines for learning terraform.

View the Project on GitHub robertdebock/learn-terraform

Workspaces

expected time requirements
30 minutes A computer with Terraform installed, terraform knowledge.

Goal: Get familiar with Terraform workspaces.

Explanation

Terraform workspaces can be used create different locations to store state. It also introduces an extra variable: terraform.workspace.

You’re always working in a workspace, but if you do no select one, you’re in the default workspace.

Howto

The arguments can be either of new, select, list, delete or show.

terraform workspace new my_workspace
terraform workspace select default
terraform workspace list
terraform workspace delete my_workspace

Demo

See this Azure repo or use the generic repo.

Assignment Azure

Assignment Generic

Questions:

  1. What are good use-cases?
  2. Do you see where you could apply this in your situation?
  3. For the generic repo, why was terraform init not required?