forked from cloudposse/terraform-aws-dynamic-subnets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
label.tf
104 lines (93 loc) · 2.91 KB
/
label.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
module "label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.14.0"
attributes = var.attributes
namespace = var.namespace
environment = var.environment
stage = var.stage
delimiter = var.delimiter
name = var.name
tags = var.tags
additional_tag_map = var.additional_tag_map
regex_replace_chars = var.regex_replace_chars
label_order = var.label_order
context = var.context
}
variable "additional_tag_map" {
type = map(string)
default = {}
description = "Additional tags for appending to each tag map"
}
variable "label_order" {
type = list(string)
default = []
description = "The naming order of the ID output and Name tag"
}
variable "regex_replace_chars" {
type = string
default = "/[^a-zA-Z0-9-]/"
description = "Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed"
}
variable "tags" {
description = "Additional tags to apply to all resources that use this label module"
type = map(string)
default = {}
}
variable "namespace" {
type = string
default = ""
description = "Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp'"
}
variable "stage" {
type = string
default = ""
description = "Stage, e.g. 'prod', 'staging', 'dev', or 'test'"
}
variable "name" {
type = string
default = ""
description = "Solution name, e.g. 'app' or 'jenkins'"
}
variable "environment" {
type = string
description = "The environment name if not using stage"
default = ""
}
variable "attributes" {
type = list(string)
description = "Any extra attributes for naming these resources"
default = []
}
variable "delimiter" {
type = string
default = "-"
description = "Delimiter to be used between `namespace`, `stage`, `name` and `attributes`"
}
variable "context" {
type = object({
namespace = string
environment = string
stage = string
name = string
enabled = bool
delimiter = string
attributes = list(string)
label_order = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
})
default = {
namespace = ""
environment = ""
stage = ""
name = ""
enabled = true
delimiter = ""
attributes = []
label_order = []
tags = {}
additional_tag_map = {}
regex_replace_chars = ""
}
description = "Default context to use for passing state between label invocations"
}