Skip to content

Commit daceadd

Browse files
feat: Added SG referencing support at TGW level
1 parent 34434c4 commit daceadd

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ No modules.
111111
| <a name="input_enable_default_route_table_propagation"></a> [enable\_default\_route\_table\_propagation](#input\_enable\_default\_route\_table\_propagation) | Whether resource attachments automatically propagate routes to the default propagation route table | `bool` | `true` | no |
112112
| <a name="input_enable_dns_support"></a> [enable\_dns\_support](#input\_enable\_dns\_support) | Should be true to enable DNS support in the TGW | `bool` | `true` | no |
113113
| <a name="input_enable_multicast_support"></a> [enable\_multicast\_support](#input\_enable\_multicast\_support) | Whether multicast support is enabled | `bool` | `false` | no |
114+
| <a name="input_enable_sg_referencing_support"></a> [enable\_sg\_referencing\_support](#input\_enable\_sg\_referencing\_support) | Indicates whether to enable security group referencing support | `bool` | `true` | no |
114115
| <a name="input_enable_vpn_ecmp_support"></a> [enable\_vpn\_ecmp\_support](#input\_enable\_vpn\_ecmp\_support) | Whether VPN Equal Cost Multipath Protocol support is enabled | `bool` | `true` | no |
115116
| <a name="input_name"></a> [name](#input\_name) | Name to be used on all the resources as identifier | `string` | `""` | no |
116117
| <a name="input_ram_allow_external_principals"></a> [ram\_allow\_external\_principals](#input\_ram\_allow\_external\_principals) | Indicates whether principals outside your organization can be associated with a resource share. | `bool` | `false` | no |

examples/complete/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module "tgw" {
2929
# When "true" there is no need for RAM resources if using multiple AWS accounts
3030
enable_auto_accept_shared_attachments = true
3131

32+
# When "true", SG referencing support is enabled at the Transit Gateway level
33+
enable_sg_referencing_support = true
34+
3235
# When "true", allows service discovery through IGMP
3336
enable_multicast_support = false
3437

main.tf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ locals {
2828
resource "aws_ec2_transit_gateway" "this" {
2929
count = var.create_tgw ? 1 : 0
3030

31-
description = coalesce(var.description, var.name)
32-
amazon_side_asn = var.amazon_side_asn
33-
default_route_table_association = var.enable_default_route_table_association ? "enable" : "disable"
34-
default_route_table_propagation = var.enable_default_route_table_propagation ? "enable" : "disable"
35-
auto_accept_shared_attachments = var.enable_auto_accept_shared_attachments ? "enable" : "disable"
36-
multicast_support = var.enable_multicast_support ? "enable" : "disable"
37-
vpn_ecmp_support = var.enable_vpn_ecmp_support ? "enable" : "disable"
38-
dns_support = var.enable_dns_support ? "enable" : "disable"
39-
transit_gateway_cidr_blocks = var.transit_gateway_cidr_blocks
31+
description = coalesce(var.description, var.name)
32+
amazon_side_asn = var.amazon_side_asn
33+
default_route_table_association = var.enable_default_route_table_association ? "enable" : "disable"
34+
default_route_table_propagation = var.enable_default_route_table_propagation ? "enable" : "disable"
35+
auto_accept_shared_attachments = var.enable_auto_accept_shared_attachments ? "enable" : "disable"
36+
multicast_support = var.enable_multicast_support ? "enable" : "disable"
37+
vpn_ecmp_support = var.enable_vpn_ecmp_support ? "enable" : "disable"
38+
dns_support = var.enable_dns_support ? "enable" : "disable"
39+
transit_gateway_cidr_blocks = var.transit_gateway_cidr_blocks
40+
security_group_referencing_support = var.enable_sg_referencing_support ? "enable" : "disable"
4041

4142
timeouts {
4243
create = try(var.timeouts.create, null)

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ variable "tgw_default_route_table_tags" {
9292
default = {}
9393
}
9494

95+
variable "enable_sg_referencing_support" {
96+
description = "Indicates whether to enable security group referencing support"
97+
type = bool
98+
default = true
99+
}
100+
95101
################################################################################
96102
# VPC Attachment
97103
################################################################################

0 commit comments

Comments
 (0)