Terraform Code 추가
This commit is contained in:
30
tf/route.tf
Normal file
30
tf/route.tf
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user