0
0
Terraformcloud~10 mins

Monorepo vs multi-repo for Terraform - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize a Terraform workspace in a monorepo setup.

Terraform
terraform [1]
Drag options to blanks, or click blank then click option'
Ainit
Bapply
Cplan
Ddestroy
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' before initializing causes errors.
Confusing 'plan' with initialization.
2fill in blank
medium

Complete the code to apply Terraform changes only in a specific directory of a multi-repo setup.

Terraform
terraform -chdir=[1] apply
Drag options to blanks, or click blank then click option'
Aterraform.tfstate
Bmodules/network
Cmain.tf
Dbackend
Attempts:
3 left
💡 Hint
Common Mistakes
Using a filename instead of a directory.
Confusing state files with directories.
3fill in blank
hard

Fix the error in the Terraform backend configuration for a monorepo by completing the missing backend type.

Terraform
terraform {
  backend "[1]" {
    bucket = "my-terraform-state"
    region = "us-east-1"
  }
}
Drag options to blanks, or click blank then click option'
Alocal
Bgcs
Cs3
Dazurerm
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'local' backend when remote state is needed.
Confusing cloud providers for backend type.
4fill in blank
hard

Fill both blanks to define a Terraform workspace command and its purpose in a multi-repo environment.

Terraform
terraform workspace [1] [2]
Drag options to blanks, or click blank then click option'
Anew
Blist
Cdev
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' instead of 'new' to create a workspace.
Using an invalid workspace name.
5fill in blank
hard

Fill all three blanks to complete a Terraform command that plans changes for a specific workspace in a monorepo.

Terraform
terraform workspace [1] && terraform plan -var-file=[2]/[3].tfvars
Drag options to blanks, or click blank then click option'
Aselect
Benvs
Cprod
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'select' to switch workspace.
Incorrect directory or filename for variable files.