Professional Documents
Culture Documents
==> 10.0.0.0/24
Create a Route table in VPC-01 Edit routes and attach internet gateway
route {
cidr_block = “0.0.0.0/0”
gateway_id = aws_internet_gateway. IGW.id
}
}
subnet selection
connectivity type
elastic ip allocation ID
create routetable RT2
attach nat gateway in RT2 and associate SN2
route {
cidr_block = “0.0.0.0/0”
nat_gateway_id = aws_nat_gateway. MYNAT.id
}
}
tags = {
Name = "New instance"
}
}
Print Public IP of the Instance
output “Public_IP” {
value= aws_instance.I-01.public_ip
}
# Create a VPC ==> 10.0.0.0/16
tags = {
Name = “SN1”
}
}
tags = {
Name = “SN3”
}
}
tags = {
Name = “SN5”
}
}
route {
cidr_block = “10.0.0.0/0”
gateway_id = aws_internet_gateway.IGW.id
}
route {
cidr_block = “10.0.0.0/0”
gateway_id = aws_nat_gateway.mynat.id
}
resource “aws_route_table_association” “public-1” {
subnet_id = aws_subnet.SN1.id
route_table_id = aws_route_table.RT1.id