Complete the code to declare an AWS S3 bucket resource.
resource "aws_s3_bucket" "[1]" { bucket = "my-example-bucket" acl = "private" }
The resource name is a local identifier used within Terraform to reference the resource. It should be a simple, descriptive name like my_bucket.
Complete the code to declare an AWS EC2 instance resource with the name 'web_server'.
resource "aws_instance" "[1]" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" }
The resource name is web_server as specified in the instruction. It identifies this EC2 instance within Terraform.
Fix the error in the resource declaration by completing the resource name correctly.
resource "aws_vpc" "[1]" { cidr_block = "10.0.0.0/16" }
The resource name must be a valid identifier without dashes or spaces. main_vpc is valid, while vpc-1 and vpc main are invalid.
Fill both blanks to declare an AWS security group resource named 'web_sg' with description 'Allow HTTP traffic'.
resource "aws_security_group" "[1]" { name = "[2]" description = "Allow HTTP traffic" vpc_id = "vpc-123456" }
name attribute.The resource name is web_sg (a valid Terraform identifier). The name attribute can have dashes and is set to web-security-group as a descriptive name.
Fill all three blanks to declare an AWS Lambda function resource named 'process_data' with runtime 'python3.8' and handler 'lambda_function.lambda_handler'.
resource "aws_lambda_function" "[1]" { function_name = "[2]" runtime = "[3]" handler = "lambda_function.lambda_handler" role = "arn:aws:iam::123456789012:role/lambda_exec_role" filename = "function.zip" }
The resource name and function_name are both process_data. The runtime is python3.8 as specified.