From 3559d4cf141c14dffce70a1c4968cf0732ab3dc1 Mon Sep 17 00:00:00 2001 From: Shabazz Abdulrahman Date: Thu, 20 Feb 2025 17:10:52 +0000 Subject: [PATCH] adding name tag in module --- modules/aws/networking/tgw-vpc-attachment/README.md | 1 + modules/aws/networking/tgw-vpc-attachment/main.tf | 4 ++++ modules/aws/networking/tgw-vpc-attachment/variables.tf | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/modules/aws/networking/tgw-vpc-attachment/README.md b/modules/aws/networking/tgw-vpc-attachment/README.md index e925929..08c772a 100644 --- a/modules/aws/networking/tgw-vpc-attachment/README.md +++ b/modules/aws/networking/tgw-vpc-attachment/README.md @@ -38,6 +38,7 @@ No requirements. |------|-------------|------|---------|:--------:| | [attachment\_subnet\_ids](#input\_attachment\_subnet\_ids) | A map of dedicated /28 subnet IDs for each AZ. The keys must match the AZ names provided in `azs`. | `map(string)` | n/a | yes | | [azs](#input\_azs) | List of Availability Zones for which the dedicated /28 subnets exist. The order of the AZs determines the order of subnets used in the attachment. | `list(string)` | n/a | yes | +| [name](#input\_name) | (Optional) Key-value tags for the EC2 Transit Gateway VPC Attachment. | `string` | n/a | yes | | [transit\_gateway\_default\_route\_table\_propagation](#input\_transit\_gateway\_default\_route\_table\_propagation) | (Optional) Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. | `bool` | `true` | no | | [transit\_gateway\_id](#input\_transit\_gateway\_id) | The ID of the Transit Gateway. | `string` | n/a | yes | | [vpc\_id](#input\_vpc\_id) | The ID of the VPC to attach. | `string` | n/a | yes | diff --git a/modules/aws/networking/tgw-vpc-attachment/main.tf b/modules/aws/networking/tgw-vpc-attachment/main.tf index 91437e9..f201693 100644 --- a/modules/aws/networking/tgw-vpc-attachment/main.tf +++ b/modules/aws/networking/tgw-vpc-attachment/main.tf @@ -12,4 +12,8 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "twg_vpc" { subnet_ids = local.ordered_attachment_subnet_ids transit_gateway_default_route_table_propagation = var.transit_gateway_default_route_table_propagation + tags = { + Name = var.name + } + } diff --git a/modules/aws/networking/tgw-vpc-attachment/variables.tf b/modules/aws/networking/tgw-vpc-attachment/variables.tf index 0730058..30eb8a2 100644 --- a/modules/aws/networking/tgw-vpc-attachment/variables.tf +++ b/modules/aws/networking/tgw-vpc-attachment/variables.tf @@ -30,3 +30,8 @@ variable "transit_gateway_default_route_table_propagation" { type = bool default = true } + +variable "name" { + type = string + description = "(Optional) Key-value tags for the EC2 Transit Gateway VPC Attachment." +} \ No newline at end of file