hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.75k stars 9.1k forks source link

[New Resources]: Default TGW association and propagation route table settings #35085

Open Michagogo opened 8 months ago

Michagogo commented 8 months ago

Description

By default, a transit gateway is created with one route table, with new attachments being automatically set up to associate with that route table and to propagate routes to it. Each of those two behaviors can be suppressed at creation, and if both are disabled the route table is not created. After creation, it’s possible to turn that behavior on and off, with enabling it requiring the user to specify a route table ID. Splitting up the route table can be desirable for use cases such as forcing all traffic through a firewall, inspection appliance, etc. (by having the default association RT be one that sends everything to the central VPC, with the appliance then sending it back through the TGW, where that connection is the only one associated with the default propagation RT). There currently seems to be no way to achieve this in Terraform - the author of my team’s module resorted to taking a region and profile name as variables and making the changes using a null resource with local-exec provisioners to make AWS CLI calls.

Conceptually this would ideally be an argument to the TGW resource itself, but in practice that doesn’t seem likely to be possible because route tables are created in the context of a TGW so you couldn’t reference one on the resource itself.

Requested Resource(s) and/or Data Source(s)

aws_ec2_transit_gatewaydefault{propagation,association}

Potential Terraform Configuration

resource "aws_ec2_transit_gateway_default_propagation" {
  transit_gateway_id = foo
  transit_gateway_route_table_id = bar
}

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 8 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue