Complete the code to declare an AWS S3 bucket resource in Terraform.
resource "aws_s3_bucket" "my_bucket" { bucket = [1] acl = "private" }
The bucket name must be a string literal in quotes to declare the resource properly.
Complete the code to output the bucket ARN after creation.
output "bucket_arn" { value = [1].arn }
The output value must reference the full resource name including provider and resource name.
Fix the error in the imperative script to create an S3 bucket using AWS CLI command.
aws s3api create-bucket --bucket [1] --region us-east-1
The bucket name should be passed without quotes in the CLI command.
Fill both blanks to declare an AWS EC2 instance with a specific AMI and instance type.
resource "aws_instance" "example" { ami = [1] instance_type = [2] }
The AMI and instance type must be valid strings in quotes to declare the EC2 instance.
Fill all three blanks to create a security group with a name, description, and ingress rule allowing HTTP traffic.
resource "aws_security_group" "web_sg" { name = [1] description = [2] ingress { from_port = 80 to_port = 80 protocol = [3] cidr_blocks = ["0.0.0.0/0"] } }
The security group requires a name and description as strings, and the protocol for HTTP is "tcp".