Skip to content

Commit 2a6f38e

Browse files
author
Steven Nemetz
committed
Update label module and define new tag variables. Define new tags for ASG. Fix issue user data no longer allowed to have length 0
1 parent 7ec4322 commit 2a6f38e

File tree

2 files changed

+62
-9
lines changed

2 files changed

+62
-9
lines changed

main.tf

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,21 @@ module "enabled" {
2020
# Define composite variables for resources
2121
module "label" {
2222
source = "devops-workflow/label/local"
23-
version = "0.1.3"
24-
organization = "${var.organization}"
23+
version = "0.2.0"
24+
attributes = "${var.attributes}"
25+
component = "${var.component}"
26+
delimiter = "${var.delimiter}"
27+
environment = "${var.environment}"
28+
monitor = "${var.monitor}"
2529
name = "${var.name}"
2630
namespace-env = "${var.namespace-env}"
2731
namespace-org = "${var.namespace-org}"
28-
environment = "${var.environment}"
29-
delimiter = "${var.delimiter}"
30-
attributes = "${var.attributes}"
32+
organization = "${var.organization}"
33+
owner = "${var.owner}"
34+
product = "${var.product}"
35+
service = "${var.service}"
3136
tags = "${var.tags}"
37+
team = "${var.team}"
3238
}
3339

3440
#######################
@@ -112,8 +118,15 @@ resource "aws_autoscaling_group" "this" {
112118

113119
tags = ["${ concat(
114120
list(
115-
map("key", "Name", "value", module.label.id, "propagate_at_launch", true),
121+
map("key", "Component", "value", var.component, "propagate_at_launch", true),
116122
map("key", "Environment", "value", module.label.environment, "propagate_at_launch", true),
123+
map("key", "Monitor", "value", var.monitor, "propagate_at_launch", true),
124+
map("key", "Name", "value", module.label.id, "propagate_at_launch", true),
125+
map("key", "Organization", "value", var.organization, "propagate_at_launch", true),
126+
map("key", "Owner", "value", var.owner, "propagate_at_launch", true),
127+
map("key", "Product", "value", var.product, "propagate_at_launch", true),
128+
map("key", "Service", "value", var.service, "propagate_at_launch", true),
129+
map("key", "Team", "value", var.team, "propagate_at_launch", true),
117130
map("key", "Terraform", "value", "true", "propagate_at_launch", true)
118131
),
119132
var.tags_ag

variables.tf

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,32 @@ variable "attributes" {
55
default = []
66
}
77

8+
variable "component" {
9+
description = "TAG: Underlying, dedicated piece of service (Cache, DB, ...)"
10+
type = "string"
11+
default = "UNDEF-ASG"
12+
}
13+
814
variable "delimiter" {
915
description = "Delimiter to be used between `name`, `namespaces`, `attributes`, etc."
16+
type = "string"
1017
default = "-"
1118
}
1219

1320
variable "environment" {
1421
description = "Environment (ex: `dev`, `qa`, `stage`, `prod`). (Second or top level namespace. Depending on namespacing options)"
22+
type = "string"
23+
}
24+
25+
variable "monitor" {
26+
description = "TAG: Should resource be monitored"
27+
type = "string"
28+
default = "UNDEF-ASG"
1529
}
1630

1731
variable "name" {
18-
description = "Base name for resources"
32+
description = "Base name for resource"
33+
type = "string"
1934
}
2035

2136
variable "namespace-env" {
@@ -29,16 +44,41 @@ variable "namespace-org" {
2944
}
3045

3146
variable "organization" {
32-
description = "Organization name (Top level namespace)."
47+
description = "Organization name (Top level namespace)"
48+
type = "string"
3349
default = ""
3450
}
3551

52+
variable "owner" {
53+
description = "TAG: Owner of the service"
54+
type = "string"
55+
default = "UNDEF-ASG"
56+
}
57+
58+
variable "product" {
59+
description = "TAG: Company/business product"
60+
type = "string"
61+
default = "UNDEF-ASG"
62+
}
63+
64+
variable "service" {
65+
description = "TAG: Application (microservice) name"
66+
type = "string"
67+
default = "UNDEF-ASG"
68+
}
69+
3670
variable "tags" {
3771
description = "A map of additional tags"
3872
type = "map"
3973
default = {}
4074
}
4175

76+
variable "team" {
77+
description = "TAG: Department/team of people responsible for service"
78+
type = "string"
79+
default = "UNDEF-ASG"
80+
}
81+
4282
// Variables specific to this module
4383
variable "enabled" {
4484
description = "Set to false to prevent the module from creating anything"
@@ -81,7 +121,7 @@ variable "associate_public_ip_address" {
81121

82122
variable "user_data" {
83123
description = "The user data to provide when launching the instance"
84-
default = ""
124+
default = " "
85125
}
86126

87127
variable "enable_monitoring" {

0 commit comments

Comments
 (0)