Skip to content

Tags for AWS resources created implicitly by other resources IIΒ #21055

Closed as not planned
@Benvorth

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.

References

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/ec2Issues and PRs that pertain to the ec2 service.staleOld or inactive issues managed by automation, if no further action taken these will get closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions