diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 071427d..f6f54bb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.77.1 + rev: v1.78.0 hooks: - id: terraform_fmt - id: terraform_validate diff --git a/modules/serverless/README.md b/modules/serverless/README.md index 334a3aa..c9c7128 100644 --- a/modules/serverless/README.md +++ b/modules/serverless/README.md @@ -134,13 +134,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 4.42 | +| [aws](#requirement\_aws) | >= 4.62 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.42 | +| [aws](#provider\_aws) | >= 4.62 | ## Modules @@ -165,6 +165,7 @@ No modules. | [auto\_stop\_configuration](#input\_auto\_stop\_configuration) | The configuration for an application to automatically stop after a certain amount of time being idle | `any` | `{}` | no | | [create](#input\_create) | Controls if resources should be created (affects nearly all resources) | `bool` | `true` | no | | [create\_security\_group](#input\_create\_security\_group) | Determines whether the security group is created | `bool` | `true` | no | +| [image\_configuration](#input\_image\_configuration) | The image configuration applied to all worker types | `any` | `{}` | no | | [initial\_capacity](#input\_initial\_capacity) | The capacity to initialize when the application is created | `any` | `{}` | no | | [maximum\_capacity](#input\_maximum\_capacity) | The maximum capacity to allocate when the application is created. This is cumulative across all workers at any given point in time, not just when an application is created. No new resources will be created once any one of the defined limits is hit | `any` | `{}` | no | | [name](#input\_name) | The name of the application | `string` | `""` | no | diff --git a/modules/serverless/main.tf b/modules/serverless/main.tf index 8b012dc..b9395bf 100644 --- a/modules/serverless/main.tf +++ b/modules/serverless/main.tf @@ -83,6 +83,14 @@ resource "aws_emrserverless_application" "this" { } } + dynamic "image_configuration" { + for_each = length(var.image_configuration) > 0 ? [var.image_configuration] : [] + + content { + image_uri = image_configuration.value.image_uri + } + } + release_label = try(coalesce(var.release_label, element(data.aws_emr_release_labels.this[0].release_labels, 0)), "") type = var.type diff --git a/modules/serverless/variables.tf b/modules/serverless/variables.tf index fcd8761..ad0f90f 100644 --- a/modules/serverless/variables.tf +++ b/modules/serverless/variables.tf @@ -32,6 +32,12 @@ variable "auto_stop_configuration" { default = {} } +variable "image_configuration" { + description = "The image configuration applied to all worker types" + type = any + default = {} +} + variable "initial_capacity" { description = "The capacity to initialize when the application is created" type = any diff --git a/modules/serverless/versions.tf b/modules/serverless/versions.tf index b8fc66b..2884bdd 100644 --- a/modules/serverless/versions.tf +++ b/modules/serverless/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.42" + version = ">= 4.62" } } }