Complete the code to specify the S3 bucket name for the backend.
terraform {
backend "s3" {
bucket = "[1]"
}
}The bucket attribute specifies the exact S3 bucket name where Terraform stores its state files.
Complete the code to specify the AWS region for the S3 backend.
terraform {
backend "s3" {
bucket = "my-terraform-state-bucket"
region = "[1]"
}
}The region attribute tells Terraform which AWS region the S3 bucket is located in.
Fix the error in the backend configuration by completing the missing key for encryption.
terraform {
backend "s3" {
bucket = "my-terraform-state-bucket"
region = "us-west-2"
[1] = true
}
}The correct key to enable server-side encryption for the S3 backend is encrypt.
Fill both blanks to configure the DynamoDB table for state locking and specify the key name.
terraform {
backend "s3" {
bucket = "my-terraform-state-bucket"
region = "us-west-2"
encrypt = true
dynamodb_table = "[1]"
[2] = "LockID"
}
}The dynamodb_table attribute specifies the DynamoDB table name used for state locking.
The key attribute defines the name of the lock item key in the table, usually 'LockID'.
Fill all three blanks to complete the S3 backend configuration with bucket, region, and encrypt enabled.
terraform {
backend "s3" {
bucket = "[1]"
region = "[2]"
encrypt = [3]
}
}This configuration sets the S3 backend bucket name, AWS region, and enables encryption for the state files.