Skip to content

feat: Support new EMR label in 6.2.0 of aws provider #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.83 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.2 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.83 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.2 |

## Modules

Expand Down Expand Up @@ -422,6 +422,7 @@ No modules.
| <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 |
| <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 |
| <a name="input_name"></a> [name](#input\_name) | Name of the job flow | `string` | `""` | no |
| <a name="input_os_release_label"></a> [os\_release\_label](#input\_os\_release\_label) | OS release label for the Amazon EMR release | `string` | `"2023.7.20250512.0"` | no |
| <a name="input_placement_group_config"></a> [placement\_group\_config](#input\_placement\_group\_config) | The specified placement group configuration | `any` | `{}` | no |
| <a name="input_release_label"></a> [release\_label](#input\_release\_label) | Release label for the Amazon EMR release | `string` | `null` | no |
| <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 |
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ resource "aws_emr_cluster" "this" {

name = var.name
release_label = try(coalesce(var.release_label, element(data.aws_emr_release_labels.this[0].release_labels, 0)), "")
os_release_label = var.os_release_label
scale_down_behavior = var.scale_down_behavior
security_configuration = var.create_security_configuration ? aws_emr_security_configuration.this[0].name : var.security_configuration_name
service_role = local.create_service_iam_role ? aws_iam_role.service[0].arn : var.service_iam_role_arn
Expand Down Expand Up @@ -526,7 +527,7 @@ data "aws_iam_policy_document" "autoscaling" {
condition {
test = "ArnLike"
variable = "aws:SourceArn"
values = ["arn:aws:elasticmapreduce:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:*"]
values = ["arn:aws:elasticmapreduce:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:*"]
}
}
}
Expand Down Expand Up @@ -590,7 +591,7 @@ data "aws_iam_policy_document" "service" {
condition {
test = "ArnLike"
variable = "aws:SourceArn"
values = ["arn:aws:elasticmapreduce:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:*"]
values = ["arn:aws:elasticmapreduce:${data.aws_region.current.region}:${data.aws_caller_identity.current.account_id}:*"]
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ variable "name" {
default = ""
}

variable "os_release_label" {
description = "OS release label for the Amazon EMR release"
type = string
default = "2023.7.20250512.0"
}

variable "placement_group_config" {
description = "The specified placement group configuration"
type = any
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.83"
version = ">= 6.2"
}
}
}