i
Size: a a a
AP
AP
VM
M
M
/* Internet gateway for the public subnet */
resource "aws_internet_gateway" "default" {
vpc_id = aws_vpc.default.id
}
/* Public subnet */
resource "aws_subnet" "public" {
vpc_id = aws_vpc.default.id
cidr_block = var.public_subnet_cidr
availability_zone = "us-west-1a"
map_public_ip_on_launch = true
depends_on = [aws_internet_gateway.default]
tag {
key = "Name"
value = "Public"
}
/* Routing table for public subnet */
resource "aws_route_table" "public" {
vpc_id = aws_vpc.default.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.default.id
}
}
/* Associate the routing table to public subnet */
resource "aws_route_table_association" "public" {
subnet_id = aws_subnet.public.id
route_table_id = aws_route_table.public.id
}
M
M
KT
/* Internet gateway for the public subnet */
resource "aws_internet_gateway" "default" {
vpc_id = aws_vpc.default.id
}
/* Public subnet */
resource "aws_subnet" "public" {
vpc_id = aws_vpc.default.id
cidr_block = var.public_subnet_cidr
availability_zone = "us-west-1a"
map_public_ip_on_launch = true
depends_on = [aws_internet_gateway.default]
tag {
key = "Name"
value = "Public"
}
/* Routing table for public subnet */
resource "aws_route_table" "public" {
vpc_id = aws_vpc.default.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.default.id
}
}
/* Associate the routing table to public subnet */
resource "aws_route_table_association" "public" {
subnet_id = aws_subnet.public.id
route_table_id = aws_route_table.public.id
}
KT
M
AM
AS
AS
AS
AM