generated from masterpointio/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
311 lines (264 loc) · 8.4 KB
/
variables.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
variable "root_module_structure" {
type = string
description = <<-EOT
The root module structure of the Stacks that you're reading in. See README for full details.
MultiInstance - You're using Workspaces or Dynamic Backend configuration to create multiple instances of the same root module code.
SingleInstance - You're using copies of a root module and your directory structure to create multiple instances of the same Terraform code.
EOT
default = "MultiInstance"
validation {
condition = contains(["MultiInstance", "SingleInstance"], var.root_module_structure)
error_message = "Valid values for root_module_structure are (MultiInstance, SingleInstance)."
}
}
variable "github_enterprise" {
type = object({
namespace = string
id = optional(string)
})
description = "The GitHub VCS settings"
default = null
}
variable "repository" {
type = string
description = "The name of your infrastructure repo"
}
variable "runner_image" {
type = string
description = "URL of the Docker image used to process Runs. Defaults to `null` which is Spacelift's standard (Alpine) runner image."
default = null
}
variable "branch" {
type = string
description = "Specify which branch to use within the infrastructure repository."
default = "main"
}
variable "root_modules_path" {
type = string
description = "The path, relative to the root of the repository, where the root module can be found."
default = "root-modules"
}
variable "enabled_root_modules" {
type = list(string)
description = <<-EOT
List of root modules where to look for stack config files.
Ignored when all_root_modules_enabled is true.
Example: ["spacelift-automation", "k8s-cluster"]
EOT
default = []
}
variable "all_root_modules_enabled" {
type = bool
description = "When set to true, all subdirectories in root_modules_path will be treated as root modules."
default = false
}
# Spacelift Backend
variable "terraform_workflow_tool" {
type = string
description = <<-EOT
Defines the tool that will be used to execute the workflow.
This can be one of OPEN_TOFU, TERRAFORM_FOSS or CUSTOM.
EOT
default = "OPEN_TOFU"
validation {
condition = contains(["OPEN_TOFU", "TERRAFORM_FOSS", "CUSTOM"], var.terraform_workflow_tool)
error_message = "Valid values for terraform_workflow_tool are (OPEN_TOFU, TERRAFORM_FOSS, CUSTOM)."
}
}
# Stack Cloud Integrations
variable "aws_integration_enabled" {
type = bool
description = "Indicates whether the AWS integration is enabled."
default = false
}
variable "aws_integration_id" {
type = string
description = "ID of the AWS integration to attach."
default = null
}
variable "aws_integration_attachment_read" {
type = bool
description = "Indicates whether this attachment is used for read operations."
default = true
}
variable "aws_integration_attachment_write" {
type = bool
description = "Indicates whether this attachment is used for write operations."
default = true
}
# Configuration for the Spacelift Stack
variable "common_config_file" {
type = string
description = "Name of the common configuration file for the stack across a root module."
default = "common.yaml"
}
# Default Stack Configuration
variable "administrative" {
type = bool
description = "Flag to mark the stack as administrative"
default = false
}
variable "additional_project_globs" {
type = set(string)
description = "Project globs is an optional list of paths to track stack changes of outside of the project root. Push policies are another alternative to track changes in additional paths."
default = []
}
variable "after_apply" {
type = list(string)
description = "List of after-apply scripts"
default = []
}
variable "after_destroy" {
type = list(string)
description = "List of after-destroy scripts"
default = []
}
variable "after_init" {
type = list(string)
description = "List of after-init scripts"
default = []
}
variable "after_perform" {
type = list(string)
description = "List of after-perform scripts"
default = []
}
variable "after_plan" {
type = list(string)
description = "List of after-plan scripts"
default = []
}
variable "autodeploy" {
type = bool
description = "Flag to enable/disable automatic deployment of the stack"
default = true
}
variable "autoretry" {
type = bool
description = "Flag to enable/disable automatic retry of the stack"
default = false
}
variable "before_apply" {
type = list(string)
description = "List of before-apply scripts"
default = []
}
variable "before_destroy" {
type = list(string)
description = "List of before-destroy scripts"
default = []
}
variable "before_init" {
type = list(string)
description = "List of before-init scripts"
default = []
}
variable "before_perform" {
type = list(string)
description = "List of before-perform scripts"
default = []
}
variable "before_plan" {
type = list(string)
description = "List of before-plan scripts"
default = []
}
variable "default_tf_workspace_enabled" {
type = bool
default = false
description = <<-EOT
Enables the use of `default` Terraform workspace instead of managing multiple workspaces within a root module.
NOTE: We encourage the use of Terraform workspaces to manage multiple environments.
However, you will want to disable this behavior if you're utilizing different backends for each instance
of your root modules (we call this "Dynamic Backends").
EOT
}
variable "description" {
type = string
description = "Description of the stack"
default = "Managed by spacelift-automation Terraform root module."
}
variable "destructor_enabled" {
type = bool
description = "Flag to enable/disable the destructor for the Stack."
default = false
}
variable "drift_detection_enabled" {
type = bool
description = "Flag to enable/disable Drift Detection configuration for a Stack."
default = false
}
variable "drift_detection_ignore_state" {
type = bool
description = <<-EOT
Controls whether drift detection should be performed on a stack
in any final state instead of just 'Finished'.
EOT
default = false
}
variable "drift_detection_reconcile" {
type = bool
description = "Flag to enable/disable automatic reconciliation of drifts."
default = false
}
variable "drift_detection_schedule" {
type = list(string)
description = "The schedule for drift detection."
default = ["0 4 * * *"]
}
variable "drift_detection_timezone" {
type = string
description = "The timezone for drift detection."
default = "UTC"
}
variable "enable_local_preview" {
type = bool
description = "Indicates whether local preview runs can be triggered on this Stack."
default = false
}
variable "enable_well_known_secret_masking" {
type = bool
description = "Indicates whether well-known secret masking is enabled."
default = true
}
variable "github_action_deploy" {
type = bool
description = "Indicates whether GitHub users can deploy from the Checks API."
default = true
}
variable "manage_state" {
type = bool
description = "Determines if Spacelift should manage state for this stack."
default = false
}
variable "protect_from_deletion" {
type = bool
description = "Protect this stack from accidental deletion. If set, attempts to delete this stack will fail."
default = false
}
variable "space_id" {
type = string
description = "Place the created stacks in the specified space_id."
default = "root"
}
variable "terraform_smart_sanitization" {
type = bool
description = <<-EOT
Indicates whether runs on this will use terraform's sensitive value system to sanitize
the outputs of Terraform state and plans in spacelift instead of sanitizing all fields.
EOT
default = false
}
variable "terraform_version" {
type = string
description = "Terraform version to use."
default = "1.7.2"
}
variable "worker_pool_id" {
type = string
description = <<-EOT
ID of the worker pool to use.
NOTE: worker_pool_id is required when using a self-hosted instance of Spacelift.
EOT
default = null
}