forked from cloudposse/terraform-null-label
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabel8d.tf
63 lines (47 loc) · 1.26 KB
/
label8d.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module "label8d" {
source = "../../"
enabled = true
namespace = "eg"
environment = "demo"
# Verify that an empty "name" will not suppress the "Name" tag
tenant = "blue"
attributes = ["cluster"]
delimiter = "-"
tags = {
"kubernetes.io/cluster/" = "shared"
}
label_order = ["namespace", "environment", "tenant", "attributes"]
# Verify an empty "stage" label will not be exported as a tag
labels_as_tags = ["environment", "name", "attributes", "stage"]
}
module "label8d_chained" {
source = "../../"
# Override should fail, should get same tags as label8d
labels_as_tags = ["namespace"]
context = module.label8d.context
}
module "label8d_context" {
source = "../../"
context = module.label8d.context
}
output "label8d_context_id" {
value = module.label8d_context.id
}
output "label8d_context_context" {
value = module.label8d_context.context
}
output "label8d_context_tags" {
value = module.label8d_context.tags
}
output "label8d_id" {
value = module.label8d.id
}
output "label8d_context" {
value = module.label8d.context
}
output "label8d_tags" {
value = module.label8d.tags
}
output "label8d_chained_context_labels_as_tags" {
value = join("-", sort(tolist(module.label8d_chained.context.labels_as_tags)))
}