Tags for AWS resources created implicitly by other resources IIΒ #21055
Closed as not planned
Description
Community Note
- Please vote on this issue by adding a π reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Like #9061 but with different resource (aws_ec2_transit_gateway_vpc_attachment
):
I have a TGW in account 1:
resource "aws_ec2_transit_gateway" "the_tgw" {
amazon_side_asn = "65501"
auto_accept_shared_attachments = "enable"
default_route_table_association = "disable"
default_route_table_propagation = "disable"
description = "My TGW in account 1"
dns_support = "enable"
vpn_ecmp_support = "enable"
tags = tomap({
Name = "TGW"
})
}
And share it via RAM with account 2.
Now I create a aws_ec2_transit_gateway_vpc_attachment
in account 2 (different terraform-run) for the shared TGW:
data "aws_ec2_transit_gateway" "the_tgw" {
filter {
name = "options.amazon-side-asn"
values = ["65501"]
}
}
# <snip>create a VPC in account 2 with subnets </snip>
resource "aws_ec2_transit_gateway_vpc_attachment" "vpc_attachment_to_tgw" {
transit_gateway_id = data.aws_ec2_transit_gateway.the_tgw.id
vpc_id = ... # my vpc.ID
subnet_ids = ... # my subnet.IDs
tags =tomap({
"Name" = "TGW attachment for VPC in account 2"
})
}
Terraform CLI and Terraform AWS Provider Version
> terraform -v
Terraform v1.0.3
on windows_amd64
+ provider registry.terraform.io/hashicorp/aws v3.59.0
Affected Resource(s)
- aws_ec2_transit_gateway_vpc_attachment,
Expected Behavior
Within account 1 the TGW attachment's tags are visible
Actual Behavior
Attachment's tags not visible in account 1 (empty), only the tgw attachment itself.