Skip to content

Commit eff2018

Browse files
authored
feat!: Add support for placement group config and unhealthy node replacement; raise AWS provider MSV to v5.44 (#21)
1 parent 0330cc0 commit eff2018

File tree

21 files changed

+67
-34
lines changed

21 files changed

+67
-34
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
330330
| Name | Version |
331331
|------|---------|
332332
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
333-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
333+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
334334

335335
## Providers
336336

337337
| Name | Version |
338338
|------|---------|
339-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
339+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
340340

341341
## Modules
342342

@@ -421,6 +421,7 @@ No modules.
421421
| <a name="input_master_security_group_description"></a> [master\_security\_group\_description](#input\_master\_security\_group\_description) | Description of the security group created | `string` | `"Managed master security group"` | no |
422422
| <a name="input_master_security_group_rules"></a> [master\_security\_group\_rules](#input\_master\_security\_group\_rules) | Security group rules to add to the security group created | `any` | <pre>{<br> "default": {<br> "cidr_blocks": [<br> "0.0.0.0/0"<br> ],<br> "description": "Allow all egress traffic",<br> "from_port": 0,<br> "ipv6_cidr_blocks": [<br> "::/0"<br> ],<br> "protocol": "-1",<br> "to_port": 0,<br> "type": "egress"<br> }<br>}</pre> | no |
423423
| <a name="input_name"></a> [name](#input\_name) | Name of the job flow | `string` | `""` | no |
424+
| <a name="input_placement_group_config"></a> [placement\_group\_config](#input\_placement\_group\_config) | The specified placement group configuration | `any` | `{}` | no |
424425
| <a name="input_release_label"></a> [release\_label](#input\_release\_label) | Release label for the Amazon EMR release | `string` | `null` | no |
425426
| <a name="input_release_label_filters"></a> [release\_label\_filters](#input\_release\_label\_filters) | Map of release label filters use to lookup a release label | `any` | <pre>{<br> "default": {<br> "prefix": "emr-6"<br> }<br>}</pre> | no |
426427
| <a name="input_scale_down_behavior"></a> [scale\_down\_behavior](#input\_scale\_down\_behavior) | Way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized | `string` | `"TERMINATE_AT_TASK_COMPLETION"` | no |
@@ -443,6 +444,7 @@ No modules.
443444
| <a name="input_task_instance_fleet"></a> [task\_instance\_fleet](#input\_task\_instance\_fleet) | 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 | `any` | `{}` | no |
444445
| <a name="input_task_instance_group"></a> [task\_instance\_group](#input\_task\_instance\_group) | 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) | `any` | `{}` | no |
445446
| <a name="input_termination_protection"></a> [termination\_protection](#input\_termination\_protection) | 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` | `bool` | `null` | no |
447+
| <a name="input_unhealthy_node_replacement"></a> [unhealthy\_node\_replacement](#input\_unhealthy\_node\_replacement) | Whether whether Amazon EMR should gracefully replace core nodes that have degraded within the cluster. Default value is `false` | `bool` | `null` | no |
446448
| <a name="input_visible_to_all_users"></a> [visible\_to\_all\_users](#input\_visible\_to\_all\_users) | Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default value is `true` | `bool` | `null` | no |
447449
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The ID of the Amazon Virtual Private Cloud (Amazon VPC) where the security groups will be created | `string` | `""` | no |
448450

examples/private-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Note that this example may create resources which will incur monetary charges on
2828
| Name | Version |
2929
|------|---------|
3030
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
31-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
31+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
3232

3333
## Providers
3434

3535
| Name | Version |
3636
|------|---------|
37-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
37+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
3838

3939
## Modules
4040

examples/private-cluster/main.tf

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ module "emr_instance_fleet" {
146146
list_steps_states = ["PENDING", "RUNNING", "CANCEL_PENDING", "CANCELLED", "FAILED", "INTERRUPTED", "COMPLETED"]
147147
log_uri = "s3://${module.s3_bucket.s3_bucket_id}/"
148148

149-
scale_down_behavior = "TERMINATE_AT_TASK_COMPLETION"
150-
step_concurrency_level = 3
151-
termination_protection = false
152-
visible_to_all_users = true
149+
scale_down_behavior = "TERMINATE_AT_TASK_COMPLETION"
150+
step_concurrency_level = 3
151+
termination_protection = false
152+
unhealthy_node_replacement = true
153+
visible_to_all_users = true
153154

154155
tags = local.tags
155156
}
@@ -192,6 +193,14 @@ module "emr_instance_group" {
192193
}
193194
])
194195

196+
# Example placement group config for multiple primary node clusters
197+
# placement_group_config = [
198+
# {
199+
# instance_role = "MASTER"
200+
# placement_strategy = "SPREAD"
201+
# }
202+
# ]
203+
195204
master_instance_group = {
196205
name = "master-group"
197206
instance_count = 1

examples/private-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
}
1010
}

examples/public-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Note that this example may create resources which will incur monetary charges on
2626
| Name | Version |
2727
|------|---------|
2828
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
3030

3131
## Providers
3232

3333
| Name | Version |
3434
|------|---------|
35-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
35+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
3636

3737
## Modules
3838

examples/public-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
}
1010
}

examples/serverless-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Note that this example may create resources which will incur monetary charges on
2626
| Name | Version |
2727
|------|---------|
2828
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
3030

3131
## Providers
3232

3333
| Name | Version |
3434
|------|---------|
35-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
35+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
3636

3737
## Modules
3838

examples/serverless-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
}
1010
}

examples/studio/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ $ terraform apply
2222
| Name | Version |
2323
|------|---------|
2424
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
2626

2727
## Providers
2828

2929
| Name | Version |
3030
|------|---------|
31-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
31+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
3232

3333
## Modules
3434

examples/studio/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
}
1010
}

examples/virtual-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ aws emr-containers list-virtual-clusters --region us-west-2 --states ARRESTED \
4545
| Name | Version |
4646
|------|---------|
4747
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
48-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
48+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
4949
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.17 |
5050
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.0 |
5151
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.7 |
@@ -54,7 +54,7 @@ aws emr-containers list-virtual-clusters --region us-west-2 --states ARRESTED \
5454

5555
| Name | Version |
5656
|------|---------|
57-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
57+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
5858
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.0 |
5959
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.7 |
6060

examples/virtual-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
kubernetes = {
1010
source = "hashicorp/kubernetes"

main.tf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,15 @@ resource "aws_emr_cluster" "this" {
272272
}
273273
}
274274

275+
dynamic "placement_group_config" {
276+
for_each = var.placement_group_config
277+
278+
content {
279+
instance_role = placement_group_config.value.instance_role
280+
placement_strategy = try(placement_group_config.value.placement_strategy, null)
281+
}
282+
}
283+
275284
name = var.name
276285
release_label = try(coalesce(var.release_label, element(data.aws_emr_release_labels.this[0].release_labels, 0)), "")
277286
scale_down_behavior = var.scale_down_behavior
@@ -299,9 +308,10 @@ resource "aws_emr_cluster" "this" {
299308
}
300309
}
301310

302-
step_concurrency_level = var.step_concurrency_level
303-
termination_protection = var.termination_protection
304-
visible_to_all_users = var.visible_to_all_users
311+
step_concurrency_level = var.step_concurrency_level
312+
termination_protection = var.termination_protection
313+
unhealthy_node_replacement = var.unhealthy_node_replacement
314+
visible_to_all_users = var.visible_to_all_users
305315

306316
tags = merge(
307317
local.tags,

modules/serverless/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
134134
| Name | Version |
135135
|------|---------|
136136
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
137-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.62 |
137+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
138138

139139
## Providers
140140

141141
| Name | Version |
142142
|------|---------|
143-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.62 |
143+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
144144

145145
## Modules
146146

modules/serverless/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.62"
7+
version = ">= 5.44"
88
}
99
}
1010
}

modules/studio/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
6868
| Name | Version |
6969
|------|---------|
7070
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
71-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
71+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
7272

7373
## Providers
7474

7575
| Name | Version |
7676
|------|---------|
77-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
77+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
7878

7979
## Modules
8080

modules/studio/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
}
1010
}

modules/virtual-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
8282
| Name | Version |
8383
|------|---------|
8484
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
85-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.42 |
85+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
8686
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.10 |
8787

8888
## Providers
8989

9090
| Name | Version |
9191
|------|---------|
92-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.42 |
92+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
9393
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.10 |
9494

9595
## Modules

modules/virtual-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
kubernetes = {
1010
source = "hashicorp/kubernetes"

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ variable "name" {
128128
default = ""
129129
}
130130

131+
variable "placement_group_config" {
132+
description = "The specified placement group configuration"
133+
type = any
134+
default = {}
135+
}
136+
131137
variable "release_label" {
132138
description = "Release label for the Amazon EMR release"
133139
type = string
@@ -169,6 +175,12 @@ variable "termination_protection" {
169175
default = null
170176
}
171177

178+
variable "unhealthy_node_replacement" {
179+
description = "Whether whether Amazon EMR should gracefully replace core nodes that have degraded within the cluster. Default value is `false`"
180+
type = bool
181+
default = null
182+
}
183+
172184
variable "visible_to_all_users" {
173185
description = "Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default value is `true`"
174186
type = bool

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 4.42"
7+
version = ">= 5.44"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)