Complete the code to initialize the Terraform working directory.
terraform [1]The terraform init command sets up the working directory by downloading necessary plugins and preparing the environment.
Complete the code to see what changes Terraform will make.
terraform [1]The terraform plan command shows the changes Terraform will apply without making any changes yet.
Fix the error in the command to apply changes safely.
terraform [1] -auto-approveThe terraform apply -auto-approve command applies changes without asking for confirmation, which should be used carefully.
Fill both blanks to create a resource and output its ID.
resource "aws_instance" "example" { ami = "ami-123456" instance_type = "t2.micro" } output "instance_id" { value = aws_instance.[1].[2] }
The resource name is example and the attribute to get the instance ID is id.
Fill all three blanks to define a variable with a default value and use it in a resource.
variable "[1]" { type = string default = "[2]" } resource "aws_s3_bucket" "bucket" { bucket = var.[3] acl = "private" }
The variable is named bucket_name, its default value is my-bucket-123, and the resource uses var.bucket_name.