Complete the code to select the Terraform workspace named 'dev'.
terraform workspace select [1]The command terraform workspace select dev switches to the 'dev' workspace.
Complete the code to initialize Terraform in the current directory.
terraform [1]The terraform init command initializes the working directory containing Terraform configuration files.
Fix the error in the command to create a new workspace named 'test'.
terraform workspace [1] testThe correct command to create a new workspace is terraform workspace new test.
Fill both blanks to define a backend configuration for Terraform state stored in an S3 bucket.
terraform {
backend "[1]" {
bucket = "my-terraform-state"
region = "[2]"
}
}The backend type for AWS S3 is 's3'. The region 'us-east-1' is a valid AWS region.
Fill all three blanks to create a directory-based separation with environment-specific variables in Terraform.
variable "region" { type = string default = "[1]" } provider "aws" { region = var.[2] } resource "aws_instance" "example" { ami = "ami-123456" instance_type = "t2.micro" tags = { Environment = "[3]" } }
The default region is set to 'us-west-1'. The provider uses the variable 'region'. The tag 'Environment' is set to 'dev' for this environment.