-
Notifications
You must be signed in to change notification settings - Fork 1
/
outputs.tf
183 lines (145 loc) · 5.26 KB
/
outputs.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
output "id" {
value = data.aws_caller_identity.this.account_id
description = "The AWS account ID of the account that corresponds to the credentials being used - the current account."
}
output "name" {
value = local.account_name
description = "The friendly name mapped to the account ID. This is loaded from the specified config, otherwise defaults to the account ID."
}
output "remote_state" {
value = lookup(local.account_config, "remote_state", {})
description = "Optional configuration about the remote state backend for the current account."
}
output "actor" {
value = {
name = local.actor_name
path = format("%s/", join("/", local.actor_slice))
session = local.actor_session
}
description = "The details of the user or role invoking the AWS API."
}
output "envs" {
value = local.environments
description = "A map of environment names to their network configurations."
}
output "env" {
value = local.current_environment
description = "Details about the currently selected environment. This will be loaded from configuration and scoped to a particular environment based on the workspace."
}
output "build" {
value = {
// Name of the environment build
name = local.current_build_name
// Domain scoped to the build
domain = lower(join(".", compact([
join(".", compact([
for part in split(".", local.subdomain_template) :
format(replace(part, format("/%s/", local.template_keys), "%s"), [
for value in flatten(regexall(local.template_keys, part)) :
lookup(merge(local.template_vars, {
environment = local.current_env_name
deployment = ""
}), value)
]...)
])), local.current_environment.domain])))
}
description = "Details about the feature build environment within the currently selected environment."
}
output "deployment" {
value = {
// Name of the environment deployment
name = local.current_deployment_name
// Domain scoped to the deployment
domain = lower(join(".", compact([
join(".", compact([
for part in split(".", local.subdomain_template) :
format(replace(part, format("/%s/", local.template_keys), "%s"), [
for value in flatten(regexall(local.template_keys, part)) :
lookup(merge(local.template_vars, {
environment = local.current_env_name
}), value)
]...)
])), local.current_environment.domain])))
}
description = "Details about the deployment environment within the currently selected environment."
}
output "is" {
value = local.helper_is
description = "A map of boolean helper outputs to reflect on whether the known accounts and environments are currently selected."
}
output "ids" {
value = {
for id, conf in local.config_data :
(conf.account.name) => id
if lookup(conf, "grouping", {}) == lookup(local.current_config, "grouping", {})
}
description = "A list of known account IDs from all known configurations."
}
output "resource_name" {
value = {
format = replace(lower(local.resource_name), "/!!!/", "%s")
prefix = lower(local.resource_name_prefix)
suffix = lower(local.resource_name_suffix)
separator = local.resource_name_separator
}
description = "An object detailing the naming format and standards for resource names."
}
output "tag_name" {
value = {
format = replace(upper(local.tag_name), "/!!!/", "%s")
prefix = upper(local.tag_name_prefix)
suffix = upper(local.tag_name_suffix)
separator = local.tag_name_separator
}
description = "An object detailing the naming format and standards for the `Name` tag."
}
output "region" {
value = {
name = data.aws_region.this.name
description = data.aws_region.this.description
zones = data.aws_availability_zones.this.names
}
description = "A map with details about the currently invoked region and it's zones filtered by the `zone_state` variable."
}
output "root" {
value = {
// Domain name for the root of the account
domain = local.root_domain
// CIDR blocks assigned to the account
cidr_blocks = lookup(local.account_config, "cidr_blocks", [])
}
description = "A map containing account level configuration such as domain name and CIDR ranges."
}
output "tags" {
value = local.tags
description = "A map of key value pairs for all tags to be propogated to resources and modules."
}
output "workspace" {
value = {
prefix = lookup(local.workspace_map, "prefix")
separator = local.workspace_prefix_separator
}
description = "A map of workspace details useful for constructing remote state data sources."
}
output "git" {
value = var.track_git ? {
organization = local.git_org
repository = local.git_repo
revision = try(local.git_commit.revision, null)
author = {
name = lookup(local.git_author, "name", null)
email = lookup(local.git_author, "email", null)
}
timestamp = try(
formatdate("DD/MM/YYYY hh:mm:ss", local.git_timestamp),
local.git_timestamp,
)
} : null
description = "A map containing information about the current git repository, revision and author"
}
output "groups" {
value = lookup(local.current_config, "grouping", {})
}
output "partition" {
value = data.aws_partition.this.partition
}