Skip to content

Commit d0a0655

Browse files
committed
feat(subnet-group): support aws v6 ofor transit_gateway_attachments
1 parent faf8b94 commit d0a0655

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

modules/subnet-group/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ This module creates following resources.
8484
| <a name="input_shares"></a> [shares](#input\_shares) | (Optional) A list of resource shares via RAM (Resource Access Manager). | <pre>list(object({<br/> name = optional(string)<br/><br/> permissions = optional(set(string), ["AWSRAMDefaultPermissionSubnet"])<br/><br/> external_principals_allowed = optional(bool, false)<br/> principals = optional(set(string), [])<br/><br/> tags = optional(map(string), {})<br/> }))</pre> | `[]` | no |
8585
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A map of tags to add to all resources. | `map(string)` | `{}` | no |
8686
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | (Optional) How long to wait for the subnet group to be created/deleted. | <pre>object({<br/> create = optional(string, "10m")<br/> delete = optional(string, "20m")<br/> })</pre> | `{}` | no |
87-
| <a name="input_transit_gateway_attachments"></a> [transit\_gateway\_attachments](#input\_transit\_gateway\_attachments) | (Optional) A list of configurations for Transit Gateway VPC attachments. Each block of `transit_gateway_attachments` as defined below.<br/> (Required) `name` - The name of the Transit Gateway VPC attachment.<br/> (Required) `transit_gateway` - The ID of the Transit Gateway.<br/> (Optional) `appliance_mode_enabled` - Whether Appliance Mode support is enabled. If enabled, a traffic flow between a source and destination uses the same Availability Zone for the VPC attachment for the lifetime of that flow. Defaults to `false`.<br/> (Optional) `dns_support_enabled` - Whether to enable Domain Name System resolution for VPCs attached to this transit gateway. Defaults to `true`.<br/> (Optional) `ipv6_enabled` - Whether to enable IPv6 support. Defaults to `false`.<br/> (Optional) `default_association_route_table_enabled` - Whether to automatically associate transit gateway attachments with this transit gateway's default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Defaults to `false`.<br/> (Optional) `default_propagation_route_table_enabled` - Whether to automatically propagate transit gateway attachments with this transit gateway's default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Defaults to `false`.<br/> (Optional) `tags` - A map of tags to add to the vpc association. | <pre>list(object({<br/> name = string<br/> transit_gateway = string<br/> appliance_mode_enabled = optional(bool, false)<br/> dns_support_enabled = optional(bool, true)<br/> ipv6_enabled = optional(bool, false)<br/> default_association_route_table_enabled = optional(bool, false)<br/> default_propagation_route_table_enabled = optional(bool, false)<br/><br/> tags = optional(map(string), {})<br/> }))</pre> | `[]` | no |
87+
| <a name="input_transit_gateway_attachments"></a> [transit\_gateway\_attachments](#input\_transit\_gateway\_attachments) | (Optional) A list of configurations for Transit Gateway VPC attachments. Each block of `transit_gateway_attachments` as defined below.<br/> (Required) `name` - The name of the Transit Gateway VPC attachment.<br/> (Required) `transit_gateway` - The ID of the Transit Gateway.<br/> (Optional) `appliance_mode_enabled` - Whether Appliance Mode support is enabled. If enabled, a traffic flow between a source and destination uses the same Availability Zone for the VPC attachment for the lifetime of that flow. Defaults to `false`.<br/> (Optional) `dns_support_enabled` - Whether to enable Domain Name System resolution for VPCs attached to this transit gateway. Defaults to `true`.<br/> (Optional) `ipv6_enabled` - Whether to enable IPv6 support. Defaults to `false`.<br/> (Optional) `security_group_referencing_enabled` - Whether to enable security group referencing support. Defaults to `false`.<br/> (Optional) `default_association_route_table_enabled` - Whether to automatically associate transit gateway attachments with this transit gateway's default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Defaults to `false`.<br/> (Optional) `default_propagation_route_table_enabled` - Whether to automatically propagate transit gateway attachments with this transit gateway's default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Defaults to `false`.<br/> (Optional) `tags` - A map of tags to add to the vpc association. | <pre>list(object({<br/> name = string<br/> transit_gateway = string<br/> appliance_mode_enabled = optional(bool, false)<br/> dns_support_enabled = optional(bool, true)<br/> ipv6_enabled = optional(bool, false)<br/> security_group_referencing_enabled = optional(bool, false)<br/> default_association_route_table_enabled = optional(bool, false)<br/> default_propagation_route_table_enabled = optional(bool, false)<br/><br/> tags = optional(map(string), {})<br/> }))</pre> | `[]` | no |
8888

8989
## Outputs
9090

modules/subnet-group/integrations.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ data "aws_ec2_transit_gateway" "this" {
1515
attachment.name => attachment.transit_gateway
1616
}
1717

18+
region = var.region
19+
1820
filter {
1921
name = "transit-gateway-id"
2022
values = [each.value]
@@ -27,14 +29,18 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "this" {
2729
attachment.name => attachment
2830
}
2931

32+
region = var.region
33+
3034
vpc_id = var.vpc_id
3135
subnet_ids = values(aws_subnet.this)[*].id
3236

3337
transit_gateway_id = each.value.transit_gateway
3438

35-
appliance_mode_support = each.value.appliance_mode_enabled ? "enable" : "disable"
36-
dns_support = each.value.dns_support_enabled ? "enable" : "disable"
37-
ipv6_support = each.value.ipv6_enabled ? "enable" : "disable"
39+
appliance_mode_support = each.value.appliance_mode_enabled ? "enable" : "disable"
40+
dns_support = each.value.dns_support_enabled ? "enable" : "disable"
41+
ipv6_support = each.value.ipv6_enabled ? "enable" : "disable"
42+
security_group_referencing_support = each.value.security_group_referencing_enabled ? "enable" : "disable"
43+
3844
transit_gateway_default_route_table_association = (local.account_id == data.aws_ec2_transit_gateway.this[each.key].owner_id
3945
? each.value.default_association_route_table_enabled
4046
: null

modules/subnet-group/outputs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ output "transit_gateway_attachments" {
140140
appliance_mode_enabled = attachment.appliance_mode_support == "enable"
141141
dns_support_enabled = attachment.dns_support == "enable"
142142
ipv6_enabled = attachment.ipv6_support == "enable"
143+
security_group_referencing_enabled = attachment.security_group_referencing_support == "enable"
143144
default_association_route_table_enabled = attachment.transit_gateway_default_route_table_association
144145
default_propagation_route_table_enabled = attachment.transit_gateway_default_route_table_propagation
145146
}

modules/subnet-group/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ variable "transit_gateway_attachments" {
222222
(Optional) `appliance_mode_enabled` - Whether Appliance Mode support is enabled. If enabled, a traffic flow between a source and destination uses the same Availability Zone for the VPC attachment for the lifetime of that flow. Defaults to `false`.
223223
(Optional) `dns_support_enabled` - Whether to enable Domain Name System resolution for VPCs attached to this transit gateway. Defaults to `true`.
224224
(Optional) `ipv6_enabled` - Whether to enable IPv6 support. Defaults to `false`.
225+
(Optional) `security_group_referencing_enabled` - Whether to enable security group referencing support. Defaults to `false`.
225226
(Optional) `default_association_route_table_enabled` - Whether to automatically associate transit gateway attachments with this transit gateway's default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Defaults to `false`.
226227
(Optional) `default_propagation_route_table_enabled` - Whether to automatically propagate transit gateway attachments with this transit gateway's default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Defaults to `false`.
227228
(Optional) `tags` - A map of tags to add to the vpc association.
@@ -232,6 +233,7 @@ variable "transit_gateway_attachments" {
232233
appliance_mode_enabled = optional(bool, false)
233234
dns_support_enabled = optional(bool, true)
234235
ipv6_enabled = optional(bool, false)
236+
security_group_referencing_enabled = optional(bool, false)
235237
default_association_route_table_enabled = optional(bool, false)
236238
default_propagation_route_table_enabled = optional(bool, false)
237239

0 commit comments

Comments
 (0)