Data Source: aws_emr_supported_instance_types

Terraform data source for managing AWS EMR Supported Instance Types.

Example Usage

Basic Usage

data "aws_emr_supported_instance_types" "example" {
  release_label = "ebs-6.15.0"
}

With a Lifecycle Pre-Condition

This data source can be used with a lifecycle precondition to ensure a given instance type is supported by EMR.

locals {
  instance_type = "r7g.large"
  release_label = "emr-6.15.0"
}

data "aws_emr_supported_instance_types" "test" {
  release_label = local.release_label
}

resource "aws_emr_cluster" "test" {
  ### additional configuration omitted for brevity ###

  release_label = local.release_label
  master_instance_group {
    instance_type = local.instance_type
  }

  lifecycle {
    precondition {
      condition     = contains(data.aws_emr_supported_instance_types.test.supported_instance_types[*].type, local.instance_type)
      error_message = "${local.instance_type} is not supported with this EMR release label!"
    }
  }
}

Argument Reference

The following arguments are required:

Attribute Reference

This data source exports the following attributes in addition to the arguments above:

supported_instance_types Attribute Reference