Skip to content

Commit

Permalink
update tags
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Dec 16, 2022
1 parent 6f20c1e commit 73efc7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions vpc-transit-gateway-association/peer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
*/

locals {
account_id = var.account_id != "" ? var.account_id : data.aws_caller_identity.current.account_id
account_environment = data.aws_arn.current.partition == "aws-us-gov" ? "gov" : "ew"
region = data.aws_region.current.name
region_short = join("", [for c in split("-", local.region) : substr(c, 0, 1)])
account_id = var.account_id != "" ? var.account_id : data.aws_caller_identity.current.account_id
account_environment = data.aws_arn.current.partition == "aws-us-gov" ? "gov" : "ew"
region = data.aws_region.current.name
region_short = join("", [for c in split("-", local.region) : substr(c, 0, 1)])
self_is_network_account = data.aws_caller_identity.current.account_id == data.aws_caller_identity.network_account.account_id

base_tags = {
"boc:tf_module_version" = local._module_version
Expand Down
3 changes: 2 additions & 1 deletion vpc-transit-gateway-association/self/associate.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
locals {
attachment_tags = {
Name = format("%v:%v", data.aws_iam_account_alias.current.account_alias, var.vpc_full_name)
"boc:tgw_environment" = var.transit_gateway_environment
"boc:tgw:environment" = var.transit_gateway_environment
"boc:tgw:label" = var.tgw_label
}
}

Expand Down
4 changes: 4 additions & 0 deletions vpc-transit-gateway-association/self/routing.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module "routing_attachment_ipv4" {
tags = merge(
local.base_tags,
var.tags,
{
"boc:tgw:environment" = var.transit_gateway_environment
"boc:tgw:label" = var.tgw_label
}
)
}

Expand Down

0 comments on commit 73efc7b

Please sign in to comment.