Skip to content

Commit 4d29ee5

Browse files
feat: Add support for image_configuration block in serverless module (#2)
Co-authored-by: Bryant Biggs <[email protected]>
1 parent a0bb477 commit 4d29ee5

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.77.1
3+
rev: v1.78.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate

modules/serverless/README.md

Lines changed: 3 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.42 |
137+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.62 |
138138

139139
## Providers
140140

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

145145
## Modules
146146

@@ -165,6 +165,7 @@ No modules.
165165
| <a name="input_auto_stop_configuration"></a> [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 |
166166
| <a name="input_create"></a> [create](#input\_create) | Controls if resources should be created (affects nearly all resources) | `bool` | `true` | no |
167167
| <a name="input_create_security_group"></a> [create\_security\_group](#input\_create\_security\_group) | Determines whether the security group is created | `bool` | `true` | no |
168+
| <a name="input_image_configuration"></a> [image\_configuration](#input\_image\_configuration) | The image configuration applied to all worker types | `any` | `{}` | no |
168169
| <a name="input_initial_capacity"></a> [initial\_capacity](#input\_initial\_capacity) | The capacity to initialize when the application is created | `any` | `{}` | no |
169170
| <a name="input_maximum_capacity"></a> [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 |
170171
| <a name="input_name"></a> [name](#input\_name) | The name of the application | `string` | `""` | no |

modules/serverless/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ resource "aws_emrserverless_application" "this" {
8383
}
8484
}
8585

86+
dynamic "image_configuration" {
87+
for_each = length(var.image_configuration) > 0 ? [var.image_configuration] : []
88+
89+
content {
90+
image_uri = image_configuration.value.image_uri
91+
}
92+
}
93+
8694
release_label = try(coalesce(var.release_label, element(data.aws_emr_release_labels.this[0].release_labels, 0)), "")
8795
type = var.type
8896

modules/serverless/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ variable "auto_stop_configuration" {
3232
default = {}
3333
}
3434

35+
variable "image_configuration" {
36+
description = "The image configuration applied to all worker types"
37+
type = any
38+
default = {}
39+
}
40+
3541
variable "initial_capacity" {
3642
description = "The capacity to initialize when the application is created"
3743
type = any

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.42"
7+
version = ">= 4.62"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)