Skip to content

Commit

Permalink
feat: Support interactive configuration block for EMR serverless appl…
Browse files Browse the repository at this point in the history
…ication (#27)

Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
  • Loading branch information
magreenbaum and bryantbiggs authored Aug 3, 2024
1 parent 90689fd commit 2e7045e
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 27 deletions.
4 changes: 2 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.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand Down
4 changes: 2 additions & 2 deletions examples/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/private-cluster/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.44"
version = ">= 5.59"
}
}
}
4 changes: 2 additions & 2 deletions examples/public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/public-cluster/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.44"
version = ">= 5.59"
}
}
}
4 changes: 2 additions & 2 deletions examples/serverless-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand Down
5 changes: 5 additions & 0 deletions examples/serverless-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ module "emr_serverless_spark" {
}
}

interactive_configuration = {
livy_endpoint_enabled = true
studio_enabled = true
}

tags = local.tags
}

Expand Down
2 changes: 1 addition & 1 deletion examples/serverless-cluster/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.44"
version = ">= 5.59"
}
}
}
4 changes: 2 additions & 2 deletions examples/studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ $ terraform apply
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/studio/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.44"
version = ">= 5.59"
}
}
}
4 changes: 2 additions & 2 deletions examples/virtual-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ aws emr-containers list-virtual-clusters --region us-west-2 --states ARRESTED \
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.17 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.0 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.7 |
Expand All @@ -54,7 +54,7 @@ aws emr-containers list-virtual-clusters --region us-west-2 --states ARRESTED \

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.0 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.7 |

Expand Down
2 changes: 1 addition & 1 deletion examples/virtual-cluster/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.44"
version = ">= 5.59"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
5 changes: 3 additions & 2 deletions modules/serverless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,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.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand All @@ -167,6 +167,7 @@ No modules.
| <a name="input_create_security_group"></a> [create\_security\_group](#input\_create\_security\_group) | Determines whether the security group is created | `bool` | `true` | no |
| <a name="input_image_configuration"></a> [image\_configuration](#input\_image\_configuration) | The image configuration applied to all worker types | `any` | `{}` | no |
| <a name="input_initial_capacity"></a> [initial\_capacity](#input\_initial\_capacity) | The capacity to initialize when the application is created | `any` | `{}` | no |
| <a name="input_interactive_configuration"></a> [interactive\_configuration](#input\_interactive\_configuration) | Enables the interactive use cases to use when running an application | `any` | `{}` | no |
| <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 |
| <a name="input_name"></a> [name](#input\_name) | The name of the application | `string` | `""` | no |
| <a name="input_network_configuration"></a> [network\_configuration](#input\_network\_configuration) | The network configuration for customer VPC connectivity | `any` | `{}` | no |
Expand Down
8 changes: 8 additions & 0 deletions modules/serverless/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ resource "aws_emrserverless_application" "this" {
}
}

dynamic "interactive_configuration" {
for_each = length(var.interactive_configuration) > 0 ? [var.interactive_configuration] : []
content {
livy_endpoint_enabled = try(interactive_configuration.value.livy_endpoint_enabled, null)
studio_enabled = try(interactive_configuration.value.studio_enabled, null)
}
}

dynamic "maximum_capacity" {
for_each = length(var.maximum_capacity) > 0 ? [var.maximum_capacity] : []

Expand Down
6 changes: 6 additions & 0 deletions modules/serverless/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ variable "initial_capacity" {
default = {}
}

variable "interactive_configuration" {
description = "Enables the interactive use cases to use when running an application"
type = any
default = {}
}

variable "maximum_capacity" {
description = "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"
type = any
Expand Down
2 changes: 1 addition & 1 deletion modules/serverless/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.44"
version = ">= 5.59"
}
}
}
4 changes: 2 additions & 2 deletions modules/studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,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.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |

## Providers

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

## Modules

Expand Down
2 changes: 1 addition & 1 deletion modules/studio/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.44"
version = ">= 5.59"
}
}
}
4 changes: 2 additions & 2 deletions modules/virtual-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ 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.44 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.59 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.10 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.44 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.59 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.10 |

## Modules
Expand Down
2 changes: 1 addition & 1 deletion modules/virtual-cluster/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.44"
version = ">= 5.59"
}
kubernetes = {
source = "hashicorp/kubernetes"
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.44"
version = ">= 5.59"
}
}
}

0 comments on commit 2e7045e

Please sign in to comment.