0
0
Terraformcloud~10 mins

Partial backend configuration in Terraform - Interactive Code Practice

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 in Terraform.

Terraform
terraform {
  backend "[1]" {}
}
Drag options to blanks, or click blank then click option'
Aazurerm
Baws_s3
Cgcs
Dlocal
Attempts:
3 left
💡 Hint
Common Mistakes
Using a cloud backend type without configuring it properly.
Forgetting to specify the backend type.
2fill in blank
medium

Complete the code to specify the bucket name for an S3 backend.

Terraform
terraform {
  backend "s3" {
    bucket = "[1]"
  }
}
Drag options to blanks, or click blank then click option'
Amy-terraform-state
Bterraform-bucket
Cstate-storage
Dbucket-name
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid bucket names with spaces or uppercase letters.
Leaving the bucket name empty.
3fill in blank
hard

Fix the error in the backend configuration by completing the region field.

Terraform
terraform {
  backend "s3" {
    bucket = "terraform-bucket"
    region = "[1]"
  }
}
Drag options to blanks, or click blank then click option'
Aus-west-2
Bus-west_2
Cuswest2
Dwest-us-2
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores instead of hyphens in region names.
Misspelling the region code.
4fill in blank
hard

Fill both blanks to configure the DynamoDB table and key for state locking.

Terraform
terraform {
  backend "s3" {
    bucket         = "terraform-bucket"
    region         = "us-west-2"
    dynamodb_table = "[1]"
    key            = "[2]"
  }
}
Drag options to blanks, or click blank then click option'
Aterraform-lock-table
Bterraform-state
Clock-key
Dstate.tfstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect or missing DynamoDB table names.
Using invalid keys that do not end with ".tfstate".
5fill in blank
hard

Fill all three blanks to complete the backend configuration with encryption and profile.

Terraform
terraform {
  backend "s3" {
    bucket         = "terraform-bucket"
    region         = "us-west-2"
    encrypt        = [1]
    dynamodb_table = "terraform-lock-table"
    profile        = "[2]"
    key            = "[3]"
  }
}
Drag options to blanks, or click blank then click option'
Atrue
Bdefault
Cprod.tfstate
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting encrypt to false when encryption is needed.
Using incorrect profile names.
Using keys that do not end with ".tfstate".