0
0
Terraformcloud~10 mins

Why remote state matters for teams in Terraform - Test Your Understanding

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

Complete the code to specify the backend type for remote state storage.

Terraform
terraform {
  backend "[1]" {}
}
Drag options to blanks, or click blank then click option'
As3
Bfile
Clocal
Dhttp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'local' backend which stores state on a single machine, not shared.
Using 'file' backend which is also local and not suitable for teams.
2fill in blank
medium

Complete the code to specify the S3 bucket name for remote state.

Terraform
terraform {
  backend "s3" {
    bucket = "[1]"
  }
}
Drag options to blanks, or click blank then click option'
Astate-storage
Blocal-state
Cterraform-files
Dmy-terraform-state
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic or local-sounding names that might confuse the purpose.
Using bucket names that do not exist or are not accessible.
3fill in blank
hard

Fix the error in the backend configuration to enable state locking with DynamoDB.

Terraform
terraform {
  backend "s3" {
    bucket         = "my-terraform-state"
    key            = "global/s3/terraform.tfstate"
    region         = "us-west-2"
    [1] = "terraform-lock"
  }
}
Drag options to blanks, or click blank then click option'
Alock_bucket
Block_table
Cdynamodb_table
Ddynamo_table
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect attribute names like 'lock_table' or 'lock_bucket'.
Misspelling the attribute name.
4fill in blank
hard

Fill both blanks to configure remote state with S3 backend and enable encryption.

Terraform
terraform {
  backend "s3" {
    bucket         = "my-terraform-state"
    key            = "prod/terraform.tfstate"
    region         = "us-east-1"
    [1] = true
    [2] = true
  }
}
Drag options to blanks, or click blank then click option'
Aencrypt
Bversioning
Cforce_destroy
Dacl
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'acl' or 'force_destroy' with encryption or versioning.
Not enabling encryption which risks data exposure.
5fill in blank
hard

Fill all three blanks to configure remote state with S3 backend, DynamoDB locking, and specify the state file path.

Terraform
terraform {
  backend "s3" {
    bucket         = "[1]"
    key            = "[2]"
    dynamodb_table = "[3]"
    region         = "us-east-2"
  }
}
Drag options to blanks, or click blank then click option'
Ateam-terraform-state
Benv/prod/terraform.tfstate
Cterraform-lock-table
Dprod-terraform-bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing bucket names with key paths.
Using incorrect DynamoDB table names.