30 lines
702 B
HCL
30 lines
702 B
HCL
resource "aws_route_table" "aws_public_rt" {
|
|
vpc_id = aws_vpc.aws-default-vpc.id
|
|
|
|
route {
|
|
cidr_block = "0.0.0.0/0"
|
|
gateway_id = aws_internet_gateway.aws_default_gateway.id
|
|
}
|
|
|
|
tags = {
|
|
Name = "aws_public_rt"
|
|
}
|
|
}
|
|
|
|
resource "aws_route_table" "aws_private_rt" {
|
|
vpc_id = aws_vpc.aws-default-vpc.id
|
|
|
|
tags = {
|
|
Name = "aws_private_rt"
|
|
}
|
|
}
|
|
|
|
resource "aws_route_table_association" "aws_pubilc_rt_association" {
|
|
subnet_id = aws_subnet.public_subnet01.id
|
|
route_table_id = aws_route_table.aws_public_rt.id
|
|
}
|
|
|
|
resource "aws_route_table_association" "aws_private_rt_association" {
|
|
subnet_id = aws_subnet.private_subnet01.id
|
|
route_table_id = aws_route_table.aws_private_rt.id
|
|
} |