Commit 2985eba4 authored by Yong Wen Chua's avatar Yong Wen Chua Committed by Anton Babenko

Manage Default Route Table under Terraform (#69)

* Manage Default Route Table under Terraform

- With name
- And Tags

* Use `aws_default_route_table` instead

* Added aws_main_route_table_association resource

* Update main.tf
parent 6d7b0916
...@@ -333,3 +333,17 @@ resource "aws_vpn_gateway" "this" { ...@@ -333,3 +333,17 @@ resource "aws_vpn_gateway" "this" {
tags = "${merge(var.tags, map("Name", format("%s", var.name)))}" tags = "${merge(var.tags, map("Name", format("%s", var.name)))}"
} }
###########
# Defaults
###########
resource "aws_default_route_table" "default" {
default_route_table_id = "${aws_vpc.this.default_route_table_id}"
tags = "${merge(var.tags, var.default_route_table_tags, map("Name", format("%s-default", var.name)))}"
}
resource "aws_main_route_table_association" "default" {
vpc_id = "${aws_vpc.this.id}"
route_table_id = "${aws_default_route_table.default.default_route_table_id}"
}
...@@ -132,6 +132,11 @@ variable "private_subnet_tags" { ...@@ -132,6 +132,11 @@ variable "private_subnet_tags" {
default = {} default = {}
} }
variable "default_route_table_tags" {
description = "Additional tags for the default route table"
default = {}
}
variable "public_route_table_tags" { variable "public_route_table_tags" {
description = "Additional tags for the public route tables" description = "Additional tags for the public route tables"
default = {} default = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment