Skip to content

Commit

Permalink
Updating and move test cases to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Nemetz committed Mar 29, 2018
1 parent 72fe752 commit f4a327a
Show file tree
Hide file tree
Showing 21 changed files with 530 additions and 59 deletions.
Empty file added examples/README.md
Empty file.
Empty file added examples/complete/README.md
Empty file.
12 changes: 12 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module "complete" {
source = "../../"
names = ["CapMe", "Test2"]
environment = "Dev"
organization = "CorpXyZ"
namespace-org = true

#attributes = ["role", "policy", "use", ""]
attributes = ["8080"]
tags = "${map("Key", "Value")}"
autoscaling_group = true
}
67 changes: 67 additions & 0 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
output "attributes" {
description = "Attribute string lowercase"
value = "${module.complete.attributes}"
}

output "environment" {
description = "Environment name lowercase"
value = "${module.complete.environment}"
}

output "id" {
description = "Full combined ID"
value = "${module.complete.id}"
}

output "name" {
description = "Name lowercase"
value = "${module.complete.name}"
}

output "id_20" {
description = "ID truncated to 20 characters"
value = "${module.complete.id_20}"
}

output "id_32" {
description = "ID truncated to 32 characters"
value = "${module.complete.id_32}"
}

output "id_attr_20" {
description = "ID max size 20 characters by truncating `id_org` then appending `attributes`"
value = "${module.complete.id_attr_20}"
}

output "id_attr_32" {
description = "ID max size 32 characters by truncating `id_org` then appending `attributes`"
value = "${module.complete.id_attr_32}"
}

output "id_env" {
description = "If env namespace enabled <env>-<name> else <name>"
value = "${module.complete.id_env}"
}

output "id_org" {
description = "If org namespace enabled <org>-<id_env> else <id_env>"
value = "${module.complete.id_org}"
}

output "organization" {
description = "Organization name lowercase"
value = "${module.complete.organization}"
}

output "tags" {
description = "Tags with standard tags added"
value = "${module.complete.tags}"
}

output "org_attr_20" {
value = "${module.complete.org_attr_20}"
}

output "org_attr_32" {
value = "${module.complete.org_attr_32}"
}
Empty file added examples/disabled/README.md
Empty file.
7 changes: 7 additions & 0 deletions examples/disabled/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module "disabled" {
source = "../../"
names = ["CapMe"]
environment = "Dev"
organization = "CorpXyZ"
enabled = false
}
67 changes: 67 additions & 0 deletions examples/disabled/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
output "attributes" {
description = "Attribute string lowercase"
value = "${module.disabled.attributes}"
}

output "environment" {
description = "Environment name lowercase"
value = "${module.disabled.environment}"
}

output "id" {
description = "Full combined ID"
value = "${module.disabled.id}"
}

output "name" {
description = "Name lowercase"
value = "${module.disabled.name}"
}

output "id_20" {
description = "ID truncated to 20 characters"
value = "${module.disabled.id_20}"
}

output "id_32" {
description = "ID truncated to 32 characters"
value = "${module.disabled.id_32}"
}

output "id_attr_20" {
description = "ID max size 20 characters by truncating `id_org` then appending `attributes`"
value = "${module.disabled.id_attr_20}"
}

output "id_attr_32" {
description = "ID max size 32 characters by truncating `id_org` then appending `attributes`"
value = "${module.disabled.id_attr_32}"
}

output "id_env" {
description = "If env namespace enabled <env>-<name> else <name>"
value = "${module.disabled.id_env}"
}

output "id_org" {
description = "If org namespace enabled <org>-<id_env> else <id_env>"
value = "${module.disabled.id_org}"
}

output "organization" {
description = "Organization name lowercase"
value = "${module.disabled.organization}"
}

output "tags" {
description = "Tags with standard tags added"
value = "${module.disabled.tags}"
}

output "org_attr_20" {
value = "${module.disabled.org_attr_20}"
}

output "org_attr_32" {
value = "${module.disabled.org_attr_32}"
}
Empty file added examples/environment/README.md
Empty file.
8 changes: 8 additions & 0 deletions examples/environment/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "env" {
source = "../../"
names = ["CapMe"]
environment = "Dev"
organization = "CorpXyZ"
namespace-env = true
namespace-org = false
}
67 changes: 67 additions & 0 deletions examples/environment/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
output "attributes" {
description = "Attribute string lowercase"
value = "${module.env.attributes}"
}

output "environment" {
description = "Environment name lowercase"
value = "${module.env.environment}"
}

output "id" {
description = "Full combined ID"
value = "${module.env.id}"
}

output "name" {
description = "Name lowercase"
value = "${module.env.name}"
}

output "id_20" {
description = "ID truncated to 20 characters"
value = "${module.env.id_20}"
}

output "id_32" {
description = "ID truncated to 32 characters"
value = "${module.env.id_32}"
}

output "id_attr_20" {
description = "ID max size 20 characters by truncating `id_org` then appending `attributes`"
value = "${module.env.id_attr_20}"
}

output "id_attr_32" {
description = "ID max size 32 characters by truncating `id_org` then appending `attributes`"
value = "${module.env.id_attr_32}"
}

output "id_env" {
description = "If env namespace enabled <env>-<name> else <name>"
value = "${module.env.id_env}"
}

output "id_org" {
description = "If org namespace enabled <org>-<id_env> else <id_env>"
value = "${module.env.id_org}"
}

output "organization" {
description = "Organization name lowercase"
value = "${module.env.organization}"
}

output "tags" {
description = "Tags with standard tags added"
value = "${module.env.tags}"
}

output "org_attr_20" {
value = "${module.env.org_attr_20}"
}

output "org_attr_32" {
value = "${module.env.org_attr_32}"
}
Empty file added examples/org-env/README.md
Empty file.
8 changes: 8 additions & 0 deletions examples/org-env/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "org-env" {
source = "../../"
names = ["Application"]
environment = "Environment"
organization = "Organization"
namespace-env = true
namespace-org = true
}
67 changes: 67 additions & 0 deletions examples/org-env/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
output "attributes" {
description = "Attribute string lowercase"
value = "${module.org-env.attributes}"
}

output "environment" {
description = "Environment name lowercase"
value = "${module.org-env.environment}"
}

output "id" {
description = "Full combined ID"
value = "${module.org-env.id}"
}

output "name" {
description = "Name lowercase"
value = "${module.org-env.name}"
}

output "id_20" {
description = "ID truncated to 20 characters"
value = "${module.org-env.id_20}"
}

output "id_32" {
description = "ID truncated to 32 characters"
value = "${module.org-env.id_32}"
}

output "id_attr_20" {
description = "ID max size 20 characters by truncating `id_org` then appending `attributes`"
value = "${module.org-env.id_attr_20}"
}

output "id_attr_32" {
description = "ID max size 32 characters by truncating `id_org` then appending `attributes`"
value = "${module.org-env.id_attr_32}"
}

output "id_env" {
description = "If env namespace enabled <env>-<name> else <name>"
value = "${module.org-env.id_env}"
}

output "id_org" {
description = "If org namespace enabled <org>-<id_env> else <id_env>"
value = "${module.org-env.id_org}"
}

output "organization" {
description = "Organization name lowercase"
value = "${module.org-env.organization}"
}

output "tags" {
description = "Tags with standard tags added"
value = "${module.org-env.tags}"
}

output "org_attr_20" {
value = "${module.org-env.org_attr_20}"
}

output "org_attr_32" {
value = "${module.org-env.org_attr_32}"
}
Empty file added examples/organization/README.md
Empty file.
8 changes: 8 additions & 0 deletions examples/organization/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "org" {
source = "../../"
names = ["CapMe"]
environment = "Dev"
organization = "CorpXyZ"
namespace-env = false
namespace-org = true
}
67 changes: 67 additions & 0 deletions examples/organization/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
output "attributes" {
description = "Attribute string lowercase"
value = "${module.org.attributes}"
}

output "environment" {
description = "Environment name lowercase"
value = "${module.org.environment}"
}

output "id" {
description = "Full combined ID"
value = "${module.org.id}"
}

output "name" {
description = "Name lowercase"
value = "${module.org.name}"
}

output "id_20" {
description = "ID truncated to 20 characters"
value = "${module.org.id_20}"
}

output "id_32" {
description = "ID truncated to 32 characters"
value = "${module.org.id_32}"
}

output "id_attr_20" {
description = "ID max size 20 characters by truncating `id_org` then appending `attributes`"
value = "${module.org.id_attr_20}"
}

output "id_attr_32" {
description = "ID max size 32 characters by truncating `id_org` then appending `attributes`"
value = "${module.org.id_attr_32}"
}

output "id_env" {
description = "If env namespace enabled <env>-<name> else <name>"
value = "${module.org.id_env}"
}

output "id_org" {
description = "If org namespace enabled <org>-<id_env> else <id_env>"
value = "${module.org.id_org}"
}

output "organization" {
description = "Organization name lowercase"
value = "${module.org.organization}"
}

output "tags" {
description = "Tags with standard tags added"
value = "${module.org.tags}"
}

output "org_attr_20" {
value = "${module.org.org_attr_20}"
}

output "org_attr_32" {
value = "${module.org.org_attr_32}"
}
Empty file added examples/tags/README.md
Empty file.
8 changes: 8 additions & 0 deletions examples/tags/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module "tags" {
source = "../../"
names = ["CapMe"]
environment = "Dev"
organization = "CorpXyZ"
attributes = ["role", "policy", "use", ""]
tags = "${map("Key", "Value")}"
}
Loading

0 comments on commit f4a327a

Please sign in to comment.