Skip to content

Commit

Permalink
Merge pull request #61 from pablo19sc/transit_gateway
Browse files Browse the repository at this point in the history
include tgw appliance mode and dns support
  • Loading branch information
drewmullen authored Jun 21, 2022
2 parents ef781be + 777a09e commit ca35ca9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/transit_gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ module "vpc" {
route_to_nat = false
transit_gateway_default_route_table_association = true
transit_gateway_default_route_table_propagation = true
transit_gateway_appliance_mode_support = "enable"
transit_gateway_dns_support = "disable"
}
}
}
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "tgw" {

transit_gateway_default_route_table_association = try(var.subnets.transit_gateway.transit_gateway_default_route_table_association, null)
transit_gateway_default_route_table_propagation = try(var.subnets.transit_gateway.transit_gateway_default_route_table_propagation, null)
appliance_mode_support = try(var.subnets.transit_gateway.transit_gateway_appliance_mode_support, "disable")
dns_support = try(var.subnets.transit_gateway.transit_gateway_dns_support, "enable")
}

resource "aws_ec2_transit_gateway_route_table_association" "tgw" {
Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ variable "subnets" {
- `transit_gateway_id` = (Required|string) Transit gateway to attach VPC to.
- `transit_gateway_default_route_table_association` = (Optional|bool) Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways.
- `transit_gateway_default_route_table_propagation` = (Optional|bool) Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways.
- `transit_gateway_appliance_mode_support` = (Optional|string) Whether Appliance Mode is enabled. If enabled, a traffic flow between a source and a destination uses the same Availability Zone for the VPC attachment for the lifetime of that flow. Valid values: `disable` (default) and `enable`.
- `transit_gateway_dns_support` = (Optional|string) DNS Support is used if you need the VPC to resolve public IPv4 DNS host names to private IPv4 addresses when queried from instances in another VPC attached to the transit gateway. Valid values: `enable` (default) and `disable`.
Example:
```
Expand Down Expand Up @@ -159,7 +161,7 @@ EOF

# All var.subnets.transit_gateway valid keys
validation {
error_message = "Invalid key in transit_gateway subnets. Valid options include: \"cidrs\", \"netmask\", \"name_prefix\", \"transit_gateway_id\", \"transit_gateway_default_route_table_association\", \"transit_gateway_default_route_table_propagation\", \"tags\"."
error_message = "Invalid key in transit_gateway subnets. Valid options include: \"cidrs\", \"netmask\", \"name_prefix\", \"transit_gateway_id\", \"transit_gateway_default_route_table_association\", \"transit_gateway_default_route_table_propagation\", \"transit_gateway_appliance_mode_support\", \"transit_gateway_dns_support\", \"tags\"."
condition = length(setsubtract(keys(try(var.subnets.transit_gateway, {})), [
"cidrs",
"netmask",
Expand All @@ -168,6 +170,8 @@ EOF
"transit_gateway_id",
"transit_gateway_default_route_table_association",
"transit_gateway_default_route_table_propagation",
"transit_gateway_appliance_mode_support",
"transit_gateway_dns_support",
"tags"
])) == 0
}
Expand Down

0 comments on commit ca35ca9

Please sign in to comment.