Complete the code to define a Terraform provider block.
provider "aws" { region = "[1]" }
The region attribute in the provider block specifies the AWS region to use, such as us-west-2.
Complete the code to define a Terraform resource block for an AWS S3 bucket.
resource "aws_s3_bucket" "[1]" { bucket = "my-unique-bucket-name" acl = "private" }
The resource block requires a name identifier after the resource type. my_bucket is a valid name.
Fix the error in the Terraform variable declaration block.
variable "instance_type" { type = [1] default = "t2.micro" }
The type attribute expects the type keyword without quotes for primitive types like string.
Fill both blanks to create a Terraform output that shows the public IP of an AWS instance.
output "instance_ip" { value = [1].[2] }
The output value should reference the resource name and the attribute public_ip to show the instance's public IP address.
Fill all three blanks to define a Terraform AWS security group with an ingress rule allowing HTTP traffic.
resource "aws_security_group" "[1]" { name = "[2]" description = "Allow HTTP inbound" ingress { from_port = [3] to_port = 80 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } }
The resource name is web_sg, the security group name is web-security-group, and the ingress port for HTTP is 80.