I have the following code:
resource "aws_ec2_transit_gateway_route_table" "non_default" {
transit_gateway_id = "${aws_ec2_transit_gateway.tgw.id}"
}
resource "aws_ec2_transit_gateway_route_table_association" "non_default_association" {
transit_gateway_attachment_id = "${aws_vpn_connection.tgw-vpn-attachment.transit_gateway_attachment_id}"
transit_gateway_route_table_id = "${aws_ec2_transit_gateway_route_table.non_default.id}"
depends_on = ["aws_vpn_connection.tgw-vpn-attachment"]
}
# Name default route table — This is not working either.
resource "aws_default_route_table" "default" {
default_route_table_id = "${aws_ec2_transit_gateway.tgw.id}"
tags = {
Name = "HelloWorld"
}
}
I want to associate the VPN gateway attachment to the non-default route table. But when I run the above code it adds it to the default route table? I need a default route table and don’t want to disable it. How can I achieve the above results?
Also when I try to add a name tag to the default route table that is not working as well.