Skip to content

Commit

Permalink
fix tags
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Nov 25, 2022
1 parent b40f2db commit b534a4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vpc-transit-gateway-association/self/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module "vpc_tgw_self" {
| Name | Type |
|------|------|
| [aws_ec2_tag.vpc_sttachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |
| [aws_ec2_tag.vpc_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |
| [aws_ec2_transit_gateway_route_table_association.route_table_self](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_route_table_association) | resource |
| [aws_ec2_transit_gateway_route_table_propagation.vpc_self_common](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_route_table_propagation) | resource |
| [aws_ec2_transit_gateway_route_table_propagation.vpc_self_own_rt](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_route_table_propagation) | resource |
Expand Down
10 changes: 5 additions & 5 deletions vpc-transit-gateway-association/self/associate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "vpc_attachment" {
)
}

# tag in network account
resource "aws_ec2_tag" "vpc_sttachment" {
# tag in network account with passed-in tags, plus Name=current_account:vpc_name
resource "aws_ec2_tag" "vpc_attachment" {
provider = aws.self
for_each = merge(var.tags, { Name = format("%v:%v", data.aws_iam_account_alias.current.account_alias, var.vpc_full_name) })

resource_id = aws_ec2_transit_gateway_vpc_attachment.vpc_attachment.id
key = "Name"
# value = format("%v:%v:%v", data.aws_iam_account_alias.network_account.account_alias,var.vpc_full_name, data.aws_region.network_account.name)
value = format("%v:%v", data.aws_iam_account_alias.current.account_alias, var.vpc_full_name)
key = each.key
value = each.value
}

output "vpc_attachment_id" {
Expand Down

0 comments on commit b534a4a

Please sign in to comment.