terraform-aws-modules / terraform-aws-transit-gateway

Terraform module to create AWS Transit Gateway resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/transit-gateway/aws
Apache License 2.0
144 stars 226 forks source link

Creating only one Transit Gateway route Table #105

Closed cunymatthieu closed 1 year ago

cunymatthieu commented 1 year ago

Description

Currently the module creates a Transit Gateway route table when the create_tgw variable is set to true. However, when we indicate to the transit gateway that we want a default route table (enable_default_route_table_association and enable_default_route_table_propagation), the route table resource aws_ec2_transit_gateway_route_table is no longer used since AWS will automatically create a routing table (by the way, it is tagged here, since it is not created by Terraform).

The idea is not to create this Transit Gateway Route table not used. When we want to use the default Route Table.

Versions

Reproduction Code [Required]

I only want to create a TransitGateway and a default TransitGateway Route Table.

module "tgw" {
  source  = "terraform-aws-modules/transit-gateway/aws"
  version = "~> 2.0"

  name        = "production-transit-gateway"
  description = "My TGW"

  create_tgw            = true
  amazon_side_asn = 64513

  enable_auto_accept_shared_attachments = true

  enable_default_route_table_association  = true
  enable_default_route_table_propagation = true
}

Expected behavior

The resource aws_ec2_transit_gateway_route_table is not created. However the default Transit Gateway Route Table is created.

We can find the route table id in these outputs in ec2_transit_gateway_association_default_route_table_id and ec2_transit_gateway_propagation_default_route_table_id.

Actual behavior

Currently 2 routing tables are created and owned by the Transit Gateway.

drAlberT commented 1 year ago

I have a similar use case.

I don't want a transit gateway route table at all, as I need to create additional route tables and I don't need/want to use the default one.

So, it would be possible to add a configuration parameter for avoiding the creation of the default routing table (and related resources of course)?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

drAlberT commented 1 year ago

This issue is a clone of another one already closed for inactivity .. is there any chance that this one could be taken into account without being automatically closed? :)

rickychew77 commented 1 year ago

Meanwhile i was thinking to able to create multiple route table as planning to use this transit gateway as a shared service, like a hub and spoke topology.

drAlberT commented 1 year ago

Meanwhile i was thinking to able to create multiple route table as planning to use this transit gateway as a shared service, like a hub and spoke topology.

Yep, hub-spoke is exactly my use case

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.