Complete the code to declare an AWS S3 bucket resource.
resource "aws_s3_bucket" [1] { bucket = "my-bucket" acl = "private" }
The resource block requires a resource name identifier after the resource type. This name is a local name used within Terraform configuration.
Complete the code to specify the resource type for an AWS EC2 instance.
resource [1] "web_server" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" }
The correct resource type for an EC2 instance in Terraform AWS provider is aws_instance.
Fix the error in the resource block by completing the missing keyword.
resource "aws_s3_bucket" "my_bucket" [1] bucket = "my-bucket" acl = "private" }
The resource block must start with an opening curly brace { after the resource name.
Fill both blanks to complete the resource block for an AWS security group.
resource [1] [2] { name = "allow_ssh" description = "Allow SSH inbound traffic" vpc_id = var.vpc_id }
The resource type is aws_security_group and the resource name is a local identifier like allow_ssh.
Fill both blanks to complete the resource block for an AWS IAM role.
resource [1] [2] { name = "example_role" assume_role_policy = data.aws_iam_policy_document.assume_role_policy.json }
The resource type is aws_iam_role, the resource name is example_role, and the block starts with {.