Complete the code to specify the AWS service that creates a private network isolated from others.
resource "aws_[1]" "main" {}
The VPC resource creates a virtual private cloud, which is an isolated network in AWS.
Complete the code to define the CIDR block that sets the IP address range for the VPC.
resource "aws_vpc" "main" { cidr_block = "[1]" }
The CIDR block 10.0.0.0/16 defines a private IP range for the VPC, isolating it from other networks.
Fix the error in the subnet resource to ensure it belongs to the correct VPC.
resource "aws_subnet" "subnet1" { vpc_id = [1] cidr_block = "10.0.1.0/24" }
The subnet must reference the VPC's ID to be part of the isolated network.
Fill both blanks to create a security group that allows inbound HTTP traffic only from inside the VPC.
resource "aws_security_group" "web_sg" { vpc_id = aws_vpc.main.id ingress { from_port = [1] to_port = [2] protocol = "tcp" cidr_blocks = ["10.0.0.0/16"] } }
Port 80 is the standard port for HTTP traffic, so both from_port and to_port should be 80.
Fill all three blanks to create a route table that directs internet traffic through the internet gateway.
resource "aws_route_table" "public" { vpc_id = [1] route { cidr_block = [2] gateway_id = [3] } }
The route table must belong to the VPC, send all internet traffic (0.0.0.0/0) through the internet gateway.