-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.tf
25 lines (19 loc) · 890 Bytes
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
locals {
name = var.name != null ? var.name : var.product
lambda_name = var.lambda_name != null ? var.lambda_name : local.name
event_rule_name = var.event_rule_name != null ? var.event_rule_name : local.name
event_rule_description = var.event_rule_description != null ? var.event_rule_description : local.name
creator = "terraform"
defaulted_tags = merge(
var.tags,
{
Name = local.name
"${var.organization}:billing:product" = var.product
"${var.organization}:billing:environment" = var.environment
creator = local.creator
repo = var.repo
}
)
tags = merge({ for k, v in local.defaulted_tags : k => v if lookup(data.aws_default_tags.common_tags.tags, k, "") != v })
}
data "aws_default_tags" "common_tags" {}