Complete the code to assign the region argument in the provider block.
provider "aws" { region = "[1]" }
The region argument expects a valid AWS region string like us-west-2.
Complete the code to set the instance type argument for the AWS EC2 resource.
resource "aws_instance" "example" { ami = "ami-0c55b159cbfafe1f0" instance_type = "[1]" }
The instance_type argument requires a valid EC2 instance type string like t2.micro.
Fix the error in the expression to correctly reference the variable 'environment'.
variable "environment" { type = string } resource "aws_s3_bucket" "bucket" { bucket = "my-app-[1]" acl = "private" }
In Terraform, to use a variable inside a string, you must use interpolation syntax like ${var.environment}.
Fill both blanks to create a map variable with keys 'dev' and 'prod' and their respective CIDR blocks.
variable "cidr_blocks" { type = map(string) default = { dev = "[1]" prod = "[2]" } }
The map variable defines CIDR blocks for 'dev' and 'prod'. Here, 'dev' uses '10.0.1.0/24' and 'prod' uses '10.0.2.0/24'.
Fill all three blanks to create a resource with a tag key 'Name' and value from a variable, and enable versioning.
resource "aws_s3_bucket" "example" { bucket = "my-bucket" tags = { Name = [1] } versioning { enabled = [2] } lifecycle_rule { id = "log" enabled = [3] } }
The tag value should be the variable var.bucket_name without quotes to reference it. Versioning and lifecycle rule 'enabled' flags are booleans set to true.