forked from terraform-aws-modules/terraform-aws-emr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
493 lines (411 loc) · 16.6 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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
variable "create" {
description = "Controls if resources should be created (affects nearly all resources)"
type = bool
default = true
}
variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
default = {}
}
################################################################################
# Cluster
################################################################################
variable "additional_info" {
description = "JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore Terraform cannot detect drift from the actual EMR cluster if its value is changed outside Terraform"
type = string
default = null
}
variable "applications" {
description = "A case-insensitive list of applications for Amazon EMR to install and configure when launching the cluster"
type = list(string)
default = []
}
variable "auto_termination_policy" {
description = "An auto-termination policy for an Amazon EMR cluster. An auto-termination policy defines the amount of idle time in seconds after which a cluster automatically terminates"
type = any
default = {}
}
variable "bootstrap_action" {
description = "Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes"
type = any
default = {}
}
variable "configurations" {
description = "List of configurations supplied for the EMR cluster you are creating. Supply a configuration object for applications to override their default configuration"
type = string
default = null
}
variable "configurations_json" {
description = "JSON string for supplying list of configurations for the EMR cluster"
type = string
default = null
}
variable "core_instance_fleet" {
description = "Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the core node type. Cannot be specified if any `core_instance_group` configuration blocks are set"
type = any
default = {}
}
variable "core_instance_group" {
description = "Configuration block to use an [Instance Group] for the core node type"
type = any
default = {}
}
variable "custom_ami_id" {
description = "Custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later"
type = string
default = null
}
variable "ebs_root_volume_size" {
description = "Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later"
type = number
default = null
}
variable "ec2_attributes" {
description = "Attributes for the EC2 instances running the job flow"
type = any
default = {}
}
variable "keep_job_flow_alive_when_no_steps" {
description = "Switch on/off run cluster with no steps or when all steps are complete (default is on)"
type = bool
default = null
}
variable "kerberos_attributes" {
description = "Kerberos configuration for the cluster"
type = any
default = {}
}
variable "list_steps_states" {
description = "List of [step states](https://docs.aws.amazon.com/emr/latest/APIReference/API_StepStatus.html) used to filter returned steps"
type = list(string)
default = []
}
variable "log_encryption_kms_key_id" {
description = "AWS KMS customer master key (CMK) key ID or arn used for encrypting log files. This attribute is only available with EMR version 5.30.0 and later, excluding EMR 6.0.0"
type = string
default = null
}
variable "log_uri" {
description = "S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created"
type = string
default = null
}
variable "master_instance_fleet" {
description = "Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the master node type. Cannot be specified if any `master_instance_group` configuration blocks are set"
type = any
default = {}
}
variable "master_instance_group" {
description = "Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master)"
type = any
default = {}
}
variable "name" {
description = "Name of the job flow"
type = string
default = ""
}
variable "release_label" {
description = "Release label for the Amazon EMR release"
type = string
default = null
}
variable "release_label_filters" {
description = "Map of release label filters use to lookup a release label"
type = any
default = {
default = {
# application = "spark@3"
prefix = "emr-6"
}
}
}
variable "scale_down_behavior" {
description = "Way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized"
type = string
default = "TERMINATE_AT_TASK_COMPLETION"
}
variable "step" {
description = "Steps to run when creating the cluster"
type = any
default = {}
}
variable "step_concurrency_level" {
description = "Number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `release_label` 5.28.0 or greater (default is 1)"
type = number
default = null
}
variable "termination_protection" {
description = "Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`"
type = bool
default = null
}
variable "visible_to_all_users" {
description = "Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default value is `true`"
type = bool
default = null
}
################################################################################
# Task Instance Fleet
# Ref: https://github.com/hashicorp/terraform-provider-aws/issues/29668
################################################################################
variable "task_instance_fleet" {
description = "Configuration block to use an [Instance Fleet](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html) for the task node type. Cannot be specified if any `task_instance_group` configuration blocks are set"
type = any
default = {}
}
################################################################################
# Task Instance Group
# Ref: https://github.com/hashicorp/terraform-provider-aws/issues/29668
################################################################################
variable "task_instance_group" {
description = "Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [task node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master)"
type = any
default = {}
}
################################################################################
# Managed Scaling Policy
################################################################################
variable "managed_scaling_policy" {
description = "Compute limit configuration for a [Managed Scaling Policy](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-scaling.html)"
type = any
default = {}
}
################################################################################
# Security Configuration
################################################################################
variable "create_security_configuration" {
description = "Determines whether a security configuration is created"
type = bool
default = false
}
variable "security_configuration_name" {
description = "Name of the security configuration to create, or attach if `create_security_configuration` is `false`. Only valid for EMR clusters with `release_label` 4.8.0 or greater"
type = string
default = null
}
variable "security_configuration_use_name_prefix" {
description = "Determines whether `security_configuration_name` is used as a prefix"
type = bool
default = true
}
variable "security_configuration" {
description = "Security configuration to create, or attach if `create_security_configuration` is `false`. Only valid for EMR clusters with `release_label` 4.8.0 or greater"
type = string
default = null
}
################################################################################
# Common IAM Role
################################################################################
variable "iam_role_use_name_prefix" {
description = "Determines whether the IAM role name is used as a prefix"
type = bool
default = true
}
variable "iam_role_path" {
description = "IAM role path"
type = string
default = null
}
variable "iam_role_permissions_boundary" {
description = "ARN of the policy that is used to set the permissions boundary for the IAM role"
type = string
default = null
}
variable "iam_role_tags" {
description = "A map of additional tags to add to the IAM role created"
type = map(string)
default = {}
}
################################################################################
# Service IAM Role
################################################################################
variable "create_service_iam_role" {
description = "Determines whether the service IAM role should be created"
type = bool
default = true
}
variable "service_iam_role_arn" {
description = "The ARN of an existing IAM role to use for the service"
type = string
default = null
}
variable "service_iam_role_name" {
description = "Name to use on IAM role created"
type = string
default = null
}
variable "service_iam_role_description" {
description = "Description of the role"
type = string
default = null
}
variable "service_iam_role_policies" {
description = "Map of IAM policies to attach to the service role"
type = map(string)
default = { AmazonEMRServicePolicy_v2 = "arn:aws:iam::aws:policy/service-role/AmazonEMRServicePolicy_v2" }
}
variable "service_pass_role_policy_name" {
description = "Name to use on IAM policy created"
type = string
default = null
}
variable "service_pass_role_policy_description" {
description = "Description of the policy"
type = string
default = null
}
################################################################################
# Autoscaling IAM Role
################################################################################
variable "create_autoscaling_iam_role" {
description = "Determines whether the autoscaling IAM role should be created"
type = bool
default = true
}
variable "autoscaling_iam_role_arn" {
description = "The ARN of an existing IAM role to use for autoscaling"
type = string
default = null
}
variable "autoscaling_iam_role_name" {
description = "Name to use on IAM role created"
type = string
default = null
}
variable "autoscaling_iam_role_description" {
description = "Description of the role"
type = string
default = null
}
################################################################################
# Instance Profile
################################################################################
variable "create_iam_instance_profile" {
description = "Determines whether the EC2 IAM role/instance profile should be created"
type = bool
default = true
}
variable "iam_instance_profile_role_name" {
description = "Name of the existing role to attach to the EC2 IAM instance profile created"
type = string
default = null
}
variable "iam_instance_profile_role_arn" {
description = "ARN of the existing role to attach to the EC2 IAM instance profile created"
type = string
default = null
}
variable "detect_iam_role_arn" {
description = "Determines whether the IAM role ARN should be detected from the `iam_instance_profile_role_name` or `iam_instance_profile_role_arn`"
type = bool
default = true
}
variable "iam_instance_profile_name" {
description = "Name to use on EC2 IAM role/instance profile created"
type = string
default = null
}
variable "iam_instance_profile_description" {
description = "Description of the EC2 IAM role/instance profile"
type = string
default = null
}
variable "iam_instance_profile_policies" {
description = "Map of IAM policies to attach to the EC2 IAM role/instance profile"
type = map(string)
default = { AmazonElasticMapReduceforEC2Role = "arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceforEC2Role" }
}
################################################################################
# Managed Security Group
################################################################################
variable "create_managed_security_groups" {
description = "Determines whether managed security groups are created"
type = bool
default = true
}
variable "managed_security_group_name" {
description = "Name to use on manged security group created. Note - `-master`, `-slave`, and `-service` will be appended to this name to distinguish"
type = string
default = null
}
variable "managed_security_group_use_name_prefix" {
description = "Determines whether the security group name (`security_group_name`) is used as a prefix"
type = bool
default = true
}
variable "managed_security_group_tags" {
description = "A map of additional tags to add to the security group created"
type = map(string)
default = {}
}
variable "vpc_id" {
description = "The ID of the Amazon Virtual Private Cloud (Amazon VPC) where the security groups will be created"
type = string
default = ""
}
################################################################################
# Managed Master Security Group
################################################################################
variable "master_security_group_description" {
description = "Description of the security group created"
type = string
default = "Managed master security group"
}
variable "master_security_group_rules" {
description = "Security group rules to add to the security group created"
type = any
default = {
"default" = {
description = "Allow all egress traffic"
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
}
}
################################################################################
# Managed Slave Security Group
################################################################################
variable "slave_security_group_description" {
description = "Description of the security group created"
type = string
default = "Managed slave security group"
}
variable "slave_security_group_rules" {
description = "Security group rules to add to the security group created"
type = any
default = {
"default" = {
description = "Allow all egress traffic"
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
}
}
################################################################################
# Managed Service Access Security Group
################################################################################
variable "is_private_cluster" {
description = "Identifies whether the cluster is created in a private subnet"
type = bool
default = true
}
variable "service_security_group_description" {
description = "Description of the security group created"
type = string
default = "Managed service access security group"
}
variable "service_security_group_rules" {
description = "Security group rules to add to the security group created"
type = any
default = {}
}