resource "aws_route_table" "rt-pri1-vpc-10-10-0-0" {
vpc_id = aws_vpc.vpc-10-10-0-0.id
/*
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.igw-vpc-10-10-0-0.id
}
*/
tags = {
Name = "rt-pri1-vpc-10-10-0-0"
}
}
resource "aws_route_table" "rt-pri2-vpc-10-10-0-0" {
vpc_id = aws_vpc.vpc-10-10-0-0.id
/*
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.igw-vpc-10-10-0-0.id
}
*/
tags = {
Name = "rt-pri2-vpc-10-10-0-0"
}
}
resource "aws_route_table_association" "rt-pri1-as1-vpc-10-10-0-0" {
subnet_id = aws_subnet.sub-pri1-10-10-3-0.id
route_table_id = aws_route_table.rt-pri1-vpc-10-10-0-0.id
}
resource "aws_route_table_association" "rt-pri2-as2-vpc-10-10-0-0" {
subnet_id = aws_subnet.sub-pri2-10-10-4-0.id
route_table_id = aws_route_table.rt-pri2-vpc-10-10-0-0.id
}
728x90
'Cloud > Terraform' 카테고리의 다른 글
Terraform - Bastion host 생성 및 Private EC2 액세스 (0) | 2022.07.09 |
---|---|
Terraform - Elastic IP 생성 및 NAT Gateway 구성 (0) | 2022.07.09 |
Terraform - Internet Gateway 생성 및 Public subnet용 Route table 구성 (0) | 2022.07.09 |
Terraform - Public subnet 및 Private subnet 생성 (0) | 2022.07.09 |
Terraform - VPC.tf 생성 및 Custom VPC 구성 (0) | 2022.07.09 |