2018-02-07 15:48:55 +00:00
|
|
|
#===========================================================================#
|
|
|
|
# Route Tables
|
|
|
|
#===========================================================================#
|
|
|
|
|
|
|
|
data "aws_internet_gateway" "default" {
|
|
|
|
filter {
|
2018-04-19 17:01:27 +00:00
|
|
|
name = "attachment.vpc-id"
|
2018-02-07 15:48:55 +00:00
|
|
|
values = ["${data.aws_vpc.default.id}"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_route_table" "rtb" {
|
|
|
|
vpc_id = "${data.aws_vpc.default.id}"
|
|
|
|
|
|
|
|
route {
|
|
|
|
cidr_block = "172.32.1.0/24"
|
|
|
|
gateway_id = "${data.aws_internet_gateway.default.id}"
|
|
|
|
}
|
2018-04-05 16:51:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_route_table" "rtb2" {
|
|
|
|
vpc_id = "${data.aws_vpc.default.id}"
|
2018-02-07 15:48:55 +00:00
|
|
|
|
2018-04-05 16:51:22 +00:00
|
|
|
route {
|
|
|
|
cidr_block = "172.32.1.0/24"
|
|
|
|
gateway_id = "${data.aws_internet_gateway.default.id}"
|
2018-02-07 15:48:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-05 16:51:22 +00:00
|
|
|
output "route_table_1_id" {
|
2018-02-07 15:48:55 +00:00
|
|
|
value = "${aws_route_table.rtb.id}"
|
|
|
|
}
|
|
|
|
|
2018-04-05 16:51:22 +00:00
|
|
|
output "route_table_2_id" {
|
|
|
|
value = "${aws_route_table.rtb2.id}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "route_table_1_propagating_vgws" {
|
2018-02-07 15:48:55 +00:00
|
|
|
value = "${aws_route_table.rtb.propagating_vgws}"
|
|
|
|
}
|
|
|
|
|
2018-04-05 16:51:22 +00:00
|
|
|
output "route_table_1_vpc_id" {
|
2018-02-07 15:48:55 +00:00
|
|
|
value = "${aws_route_table.rtb.vpc_id}"
|
|
|
|
}
|