Skip to content

Commit d8e1d75

Browse files
author
Steven Nemetz
committed
Redo test cases as exmaples
1 parent 7c46b02 commit d8e1d75

File tree

19 files changed

+458
-0
lines changed

19 files changed

+458
-0
lines changed

examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# Example and manual test cases
3+
4+
Each directory contains a configuration that serves as a manual test case and an example

examples/attributes/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example using attributes

examples/attributes/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module "labels" {
2+
source = "../"
3+
name = "CapMe"
4+
environment = "Dev"
5+
organization = "CorpXyZ"
6+
attributes = ["role", "policy", "use", ""]
7+
autoscaling_group = true
8+
}

examples/attributes/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+
}

examples/env/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example using Environment namespace

examples/env/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module "labels" {
2+
source = "../"
3+
name = "CapMe"
4+
environment = "Dev"
5+
organization = "CorpXyZ"
6+
namespace-env = true
7+
namespace-org = false
8+
}

examples/env/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+
}

examples/labels/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example basic module use

examples/labels/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module "labels" {
2+
source = "../"
3+
name = "CapMe"
4+
environment = "Dev"
5+
organization = "CorpXyZ"
6+
}

examples/labels/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+
}

examples/org-env/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example using both Environment and Organization name spaces

examples/org-env/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module "labels" {
2+
source = "../"
3+
name = "CapMe"
4+
environment = "Dev"
5+
organization = "CorpXyZ"
6+
namespace-env = true
7+
namespace-org = true
8+
}

examples/org-env/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+
}

examples/org/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Example using Organization namespace

examples/org/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module "labels" {
2+
source = "../"
3+
name = "CapMe"
4+
environment = "Dev"
5+
organization = "CorpXyZ"
6+
namespace-env = false
7+
namespace-org = true
8+
}

examples/org/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+
}

examples/tags/README.md

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

0 commit comments

Comments
 (0)