Skip to content

Commit 45c884f

Browse files
author
Steven Nemetz
committed
Add example for all new tags defined
1 parent cccbdc4 commit 45c884f

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

examples/tags-full/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example with all tags defined

examples/tags-full/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module "labels" {
2+
source = "../../"
3+
name = "CapMe"
4+
environment = "Dev"
5+
organization = "CorpXyZ"
6+
attributes = ["8080"]
7+
tags = "${map("Key", "Value")}"
8+
component = "Component A"
9+
monitor = "Monitor Datadog"
10+
owner = "Freddy"
11+
product = "Product 1"
12+
service = "Service 1"
13+
team = "Backend developers"
14+
}

examples/tags-full/outputs.tf

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
output "attributes" {
2+
description = "Attribute string lowercase"
3+
value = "${module.labels.attributes}"
4+
}
5+
6+
output "environment" {
7+
description = "Environment name lowercase"
8+
value = "${module.labels.environment}"
9+
}
10+
11+
output "id" {
12+
description = "Full combined ID"
13+
value = "${module.labels.id}"
14+
}
15+
16+
output "name" {
17+
description = "Name lowercase"
18+
value = "${module.labels.name}"
19+
}
20+
21+
output "id_20" {
22+
description = "ID truncated to 20 characters"
23+
value = "${module.labels.id_20}"
24+
}
25+
26+
output "id_32" {
27+
description = "ID truncated to 32 characters"
28+
value = "${module.labels.id_32}"
29+
}
30+
31+
output "id_attr_20" {
32+
description = "ID max size 20 characters by truncating `id_org` then appending `attributes`"
33+
value = "${module.labels.id_attr_20}"
34+
}
35+
36+
output "id_attr_32" {
37+
description = "ID max size 32 characters by truncating `id_org` then appending `attributes`"
38+
value = "${module.labels.id_attr_32}"
39+
}
40+
41+
output "id_env" {
42+
description = "If env namespace enabled <env>-<name> else <name>"
43+
value = "${module.labels.id_env}"
44+
}
45+
46+
output "id_org" {
47+
description = "If org namespace enabled <org>-<id_env> else <id_env>"
48+
value = "${module.labels.id_org}"
49+
}
50+
51+
output "organization" {
52+
description = "Organization name lowercase"
53+
value = "${module.labels.organization}"
54+
}
55+
56+
output "tags" {
57+
description = "Tags with standard tags added"
58+
value = "${module.labels.tags}"
59+
}
60+
61+
output "org_attr_20" {
62+
value = "${module.labels.org_attr_20}"
63+
}
64+
65+
output "org_attr_32" {
66+
value = "${module.labels.org_attr_32}"
67+
}

0 commit comments

Comments
 (0)