From d2bfdbbbee83f2944aac9d9f231ec40c0f31a927 Mon Sep 17 00:00:00 2001 From: Steven Nemetz Date: Wed, 16 May 2018 14:25:48 -0700 Subject: [PATCH] Update label module and define new tag variables --- main.tf | 16 +++++++++++----- test/main.tf | 23 ----------------------- variables.tf | 46 +++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 52 insertions(+), 33 deletions(-) delete mode 100644 test/main.tf diff --git a/main.tf b/main.tf index 399093c..e79bb73 100644 --- a/main.tf +++ b/main.tf @@ -13,15 +13,21 @@ module "enabled" { # Define composite variables for resources module "label" { source = "devops-workflow/label/local" - version = "0.1.0" - organization = "${var.organization}" + version = "0.2.0" + attributes = "${var.attributes}" + component = "${var.component}" + delimiter = "${var.delimiter}" + environment = "${var.environment}" + monitor = "${var.monitor}" name = "${var.name}" namespace-env = "${var.namespace-env}" namespace-org = "${var.namespace-org}" - environment = "${var.environment}" - delimiter = "${var.delimiter}" - attributes = "${var.attributes}" + organization = "${var.organization}" + owner = "${var.owner}" + product = "${var.product}" + service = "${var.service}" tags = "${var.tags}" + team = "${var.team}" } resource "aws_efs_file_system" "default" { diff --git a/test/main.tf b/test/main.tf deleted file mode 100644 index 440ab77..0000000 --- a/test/main.tf +++ /dev/null @@ -1,23 +0,0 @@ -# Lookup DNS zone, vpc, subnets - -module "efs" { - source = "../" - name = "efs-vol" - environment = "testing" - organization = "" - - #attributes = ["role", "policy", "use", ""] - #tags = "${map("Key", "Value")}" - zone_id = "ZURF67XJUWC5A" # one - - security_groups = [] - ingress_cidr = ["10.0.0.0/8"] - subnets = ["subnet-857efce3", "subnet-0852f140", "subnet-6395c038"] - vpc_id = "vpc-417c0027" # one - - #enabled = false -} - -# Test: -# enabled = false - diff --git a/variables.tf b/variables.tf index 9052c6d..b5aea8c 100644 --- a/variables.tf +++ b/variables.tf @@ -5,6 +5,12 @@ variable "attributes" { default = [] } +variable "component" { + description = "TAG: Underlying, dedicated piece of service (Cache, DB, ...)" + type = "string" + default = "UNDEF-EFS" +} + variable "delimiter" { description = "Delimiter to be used between `name`, `namespaces`, `attributes`, etc." type = "string" @@ -12,37 +18,67 @@ variable "delimiter" { } variable "environment" { - description = "Environment (ex: dev, qa, stage, prod)" + description = "Environment (ex: `dev`, `qa`, `stage`, `prod`). (Second or top level namespace. Depending on namespacing options)" type = "string" } +variable "monitor" { + description = "TAG: Should resource be monitored" + type = "string" + default = "UNDEF-EFS" +} + variable "name" { description = "Base name for resource" type = "string" } variable "namespace-env" { - description = "Prefix name with the environment" + description = "Prefix name with the environment. If true, format is: -" default = true } variable "namespace-org" { - description = "Prefix name with the organization. If both env and org namespaces are used, format will be --" + description = "Prefix name with the organization. If true, format is: -. If both env and org namespaces are used, format will be --" default = false } variable "organization" { - description = "Organization name" + description = "Organization name (Top level namespace)" type = "string" default = "" } +variable "owner" { + description = "TAG: Owner of the service" + type = "string" + default = "UNDEF-EFS" +} + +variable "product" { + description = "TAG: Company/business product" + type = "string" + default = "UNDEF-EFS" +} + +variable "service" { + description = "TAG: Application (microservice) name" + type = "string" + default = "UNDEF-EFS" +} + variable "tags" { - description = "A map of additional tags to add" + description = "A map of additional tags" type = "map" default = {} } +variable "team" { + description = "TAG: Department/team of people responsible for service" + type = "string" + default = "UNDEF-EFS" +} + // Variables specific to module route53-cluster-hostname variable "dns_ttl" { description = "TTL of the DNS record"