aws-cdk-lib.aws_emr.CfnClusterProps

interface CfnClusterProps

LanguageType name
.NETAmazon.CDK.AWS.EMR.CfnClusterProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsemr#CfnClusterProps
Javasoftware.amazon.awscdk.services.emr.CfnClusterProps
Pythonaws_cdk.aws_emr.CfnClusterProps
TypeScript aws-cdk-lib » aws_emr » CfnClusterProps

Properties for defining a CfnCluster.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_emr as emr } from 'aws-cdk-lib';

declare const additionalInfo: any;
declare const configurationProperty_: emr.CfnCluster.ConfigurationProperty;
const cfnClusterProps: emr.CfnClusterProps = {
  instances: {
    additionalMasterSecurityGroups: ['additionalMasterSecurityGroups'],
    additionalSlaveSecurityGroups: ['additionalSlaveSecurityGroups'],
    coreInstanceFleet: {
      instanceTypeConfigs: [{
        instanceType: 'instanceType',

        // the properties below are optional
        bidPrice: 'bidPrice',
        bidPriceAsPercentageOfOnDemandPrice: 123,
        configurations: [{
          classification: 'classification',
          configurationProperties: {
            configurationPropertiesKey: 'configurationProperties',
          },
          configurations: [configurationProperty_],
        }],
        customAmiId: 'customAmiId',
        ebsConfiguration: {
          ebsBlockDeviceConfigs: [{
            volumeSpecification: {
              sizeInGb: 123,
              volumeType: 'volumeType',

              // the properties below are optional
              iops: 123,
            },

            // the properties below are optional
            volumesPerInstance: 123,
          }],
          ebsOptimized: false,
        },
        weightedCapacity: 123,
      }],
      launchSpecifications: {
        onDemandSpecification: {
          allocationStrategy: 'allocationStrategy',
        },
        spotSpecification: {
          timeoutAction: 'timeoutAction',
          timeoutDurationMinutes: 123,

          // the properties below are optional
          allocationStrategy: 'allocationStrategy',
          blockDurationMinutes: 123,
        },
      },
      name: 'name',
      targetOnDemandCapacity: 123,
      targetSpotCapacity: 123,
    },
    coreInstanceGroup: {
      instanceCount: 123,
      instanceType: 'instanceType',

      // the properties below are optional
      autoScalingPolicy: {
        constraints: {
          maxCapacity: 123,
          minCapacity: 123,
        },
        rules: [{
          action: {
            simpleScalingPolicyConfiguration: {
              scalingAdjustment: 123,

              // the properties below are optional
              adjustmentType: 'adjustmentType',
              coolDown: 123,
            },

            // the properties below are optional
            market: 'market',
          },
          name: 'name',
          trigger: {
            cloudWatchAlarmDefinition: {
              comparisonOperator: 'comparisonOperator',
              metricName: 'metricName',
              period: 123,
              threshold: 123,

              // the properties below are optional
              dimensions: [{
                key: 'key',
                value: 'value',
              }],
              evaluationPeriods: 123,
              namespace: 'namespace',
              statistic: 'statistic',
              unit: 'unit',
            },
          },

          // the properties below are optional
          description: 'description',
        }],
      },
      bidPrice: 'bidPrice',
      configurations: [{
        classification: 'classification',
        configurationProperties: {
          configurationPropertiesKey: 'configurationProperties',
        },
        configurations: [configurationProperty_],
      }],
      customAmiId: 'customAmiId',
      ebsConfiguration: {
        ebsBlockDeviceConfigs: [{
          volumeSpecification: {
            sizeInGb: 123,
            volumeType: 'volumeType',

            // the properties below are optional
            iops: 123,
          },

          // the properties below are optional
          volumesPerInstance: 123,
        }],
        ebsOptimized: false,
      },
      market: 'market',
      name: 'name',
    },
    ec2KeyName: 'ec2KeyName',
    ec2SubnetId: 'ec2SubnetId',
    ec2SubnetIds: ['ec2SubnetIds'],
    emrManagedMasterSecurityGroup: 'emrManagedMasterSecurityGroup',
    emrManagedSlaveSecurityGroup: 'emrManagedSlaveSecurityGroup',
    hadoopVersion: 'hadoopVersion',
    keepJobFlowAliveWhenNoSteps: false,
    masterInstanceFleet: {
      instanceTypeConfigs: [{
        instanceType: 'instanceType',

        // the properties below are optional
        bidPrice: 'bidPrice',
        bidPriceAsPercentageOfOnDemandPrice: 123,
        configurations: [{
          classification: 'classification',
          configurationProperties: {
            configurationPropertiesKey: 'configurationProperties',
          },
          configurations: [configurationProperty_],
        }],
        customAmiId: 'customAmiId',
        ebsConfiguration: {
          ebsBlockDeviceConfigs: [{
            volumeSpecification: {
              sizeInGb: 123,
              volumeType: 'volumeType',

              // the properties below are optional
              iops: 123,
            },

            // the properties below are optional
            volumesPerInstance: 123,
          }],
          ebsOptimized: false,
        },
        weightedCapacity: 123,
      }],
      launchSpecifications: {
        onDemandSpecification: {
          allocationStrategy: 'allocationStrategy',
        },
        spotSpecification: {
          timeoutAction: 'timeoutAction',
          timeoutDurationMinutes: 123,

          // the properties below are optional
          allocationStrategy: 'allocationStrategy',
          blockDurationMinutes: 123,
        },
      },
      name: 'name',
      targetOnDemandCapacity: 123,
      targetSpotCapacity: 123,
    },
    masterInstanceGroup: {
      instanceCount: 123,
      instanceType: 'instanceType',

      // the properties below are optional
      autoScalingPolicy: {
        constraints: {
          maxCapacity: 123,
          minCapacity: 123,
        },
        rules: [{
          action: {
            simpleScalingPolicyConfiguration: {
              scalingAdjustment: 123,

              // the properties below are optional
              adjustmentType: 'adjustmentType',
              coolDown: 123,
            },

            // the properties below are optional
            market: 'market',
          },
          name: 'name',
          trigger: {
            cloudWatchAlarmDefinition: {
              comparisonOperator: 'comparisonOperator',
              metricName: 'metricName',
              period: 123,
              threshold: 123,

              // the properties below are optional
              dimensions: [{
                key: 'key',
                value: 'value',
              }],
              evaluationPeriods: 123,
              namespace: 'namespace',
              statistic: 'statistic',
              unit: 'unit',
            },
          },

          // the properties below are optional
          description: 'description',
        }],
      },
      bidPrice: 'bidPrice',
      configurations: [{
        classification: 'classification',
        configurationProperties: {
          configurationPropertiesKey: 'configurationProperties',
        },
        configurations: [configurationProperty_],
      }],
      customAmiId: 'customAmiId',
      ebsConfiguration: {
        ebsBlockDeviceConfigs: [{
          volumeSpecification: {
            sizeInGb: 123,
            volumeType: 'volumeType',

            // the properties below are optional
            iops: 123,
          },

          // the properties below are optional
          volumesPerInstance: 123,
        }],
        ebsOptimized: false,
      },
      market: 'market',
      name: 'name',
    },
    placement: {
      availabilityZone: 'availabilityZone',
    },
    serviceAccessSecurityGroup: 'serviceAccessSecurityGroup',
    taskInstanceFleets: [{
      instanceTypeConfigs: [{
        instanceType: 'instanceType',

        // the properties below are optional
        bidPrice: 'bidPrice',
        bidPriceAsPercentageOfOnDemandPrice: 123,
        configurations: [{
          classification: 'classification',
          configurationProperties: {
            configurationPropertiesKey: 'configurationProperties',
          },
          configurations: [configurationProperty_],
        }],
        customAmiId: 'customAmiId',
        ebsConfiguration: {
          ebsBlockDeviceConfigs: [{
            volumeSpecification: {
              sizeInGb: 123,
              volumeType: 'volumeType',

              // the properties below are optional
              iops: 123,
            },

            // the properties below are optional
            volumesPerInstance: 123,
          }],
          ebsOptimized: false,
        },
        weightedCapacity: 123,
      }],
      launchSpecifications: {
        onDemandSpecification: {
          allocationStrategy: 'allocationStrategy',
        },
        spotSpecification: {
          timeoutAction: 'timeoutAction',
          timeoutDurationMinutes: 123,

          // the properties below are optional
          allocationStrategy: 'allocationStrategy',
          blockDurationMinutes: 123,
        },
      },
      name: 'name',
      targetOnDemandCapacity: 123,
      targetSpotCapacity: 123,
    }],
    taskInstanceGroups: [{
      instanceCount: 123,
      instanceType: 'instanceType',

      // the properties below are optional
      autoScalingPolicy: {
        constraints: {
          maxCapacity: 123,
          minCapacity: 123,
        },
        rules: [{
          action: {
            simpleScalingPolicyConfiguration: {
              scalingAdjustment: 123,

              // the properties below are optional
              adjustmentType: 'adjustmentType',
              coolDown: 123,
            },

            // the properties below are optional
            market: 'market',
          },
          name: 'name',
          trigger: {
            cloudWatchAlarmDefinition: {
              comparisonOperator: 'comparisonOperator',
              metricName: 'metricName',
              period: 123,
              threshold: 123,

              // the properties below are optional
              dimensions: [{
                key: 'key',
                value: 'value',
              }],
              evaluationPeriods: 123,
              namespace: 'namespace',
              statistic: 'statistic',
              unit: 'unit',
            },
          },

          // the properties below are optional
          description: 'description',
        }],
      },
      bidPrice: 'bidPrice',
      configurations: [{
        classification: 'classification',
        configurationProperties: {
          configurationPropertiesKey: 'configurationProperties',
        },
        configurations: [configurationProperty_],
      }],
      customAmiId: 'customAmiId',
      ebsConfiguration: {
        ebsBlockDeviceConfigs: [{
          volumeSpecification: {
            sizeInGb: 123,
            volumeType: 'volumeType',

            // the properties below are optional
            iops: 123,
          },

          // the properties below are optional
          volumesPerInstance: 123,
        }],
        ebsOptimized: false,
      },
      market: 'market',
      name: 'name',
    }],
    terminationProtected: false,
  },
  jobFlowRole: 'jobFlowRole',
  name: 'name',
  serviceRole: 'serviceRole',

  // the properties below are optional
  additionalInfo: additionalInfo,
  applications: [{
    additionalInfo: {
      additionalInfoKey: 'additionalInfo',
    },
    args: ['args'],
    name: 'name',
    version: 'version',
  }],
  autoScalingRole: 'autoScalingRole',
  autoTerminationPolicy: {
    idleTimeout: 123,
  },
  bootstrapActions: [{
    name: 'name',
    scriptBootstrapAction: {
      path: 'path',

      // the properties below are optional
      args: ['args'],
    },
  }],
  configurations: [{
    classification: 'classification',
    configurationProperties: {
      configurationPropertiesKey: 'configurationProperties',
    },
    configurations: [configurationProperty_],
  }],
  customAmiId: 'customAmiId',
  ebsRootVolumeSize: 123,
  kerberosAttributes: {
    kdcAdminPassword: 'kdcAdminPassword',
    realm: 'realm',

    // the properties below are optional
    adDomainJoinPassword: 'adDomainJoinPassword',
    adDomainJoinUser: 'adDomainJoinUser',
    crossRealmTrustPrincipalPassword: 'crossRealmTrustPrincipalPassword',
  },
  logEncryptionKmsKeyId: 'logEncryptionKmsKeyId',
  logUri: 'logUri',
  managedScalingPolicy: {
    computeLimits: {
      maximumCapacityUnits: 123,
      minimumCapacityUnits: 123,
      unitType: 'unitType',

      // the properties below are optional
      maximumCoreCapacityUnits: 123,
      maximumOnDemandCapacityUnits: 123,
    },
  },
  osReleaseLabel: 'osReleaseLabel',
  releaseLabel: 'releaseLabel',
  scaleDownBehavior: 'scaleDownBehavior',
  securityConfiguration: 'securityConfiguration',
  stepConcurrencyLevel: 123,
  steps: [{
    hadoopJarStep: {
      jar: 'jar',

      // the properties below are optional
      args: ['args'],
      mainClass: 'mainClass',
      stepProperties: [{
        key: 'key',
        value: 'value',
      }],
    },
    name: 'name',

    // the properties below are optional
    actionOnFailure: 'actionOnFailure',
  }],
  tags: [{
    key: 'key',
    value: 'value',
  }],
  visibleToAllUsers: false,
};

Properties

NameTypeDescription
instancesIResolvable | JobFlowInstancesConfigPropertyA specification of the number and type of Amazon EC2 instances.
jobFlowRolestringAlso called instance profile and Amazon EC2 role.
namestringThe name of the cluster.
serviceRolestringThe IAM role that Amazon EMR assumes in order to access AWS resources on your behalf.
additionalInfo?anyA JSON string for selecting additional features.
applications?IResolvable | IResolvable | ApplicationProperty[]The applications to install on this cluster, for example, Spark, Flink, Oozie, Zeppelin, and so on.
autoScalingRole?stringAn IAM role for automatic scaling policies.
autoTerminationPolicy?IResolvable | AutoTerminationPolicyPropertyAWS::EMR::Cluster.AutoTerminationPolicy.
bootstrapActions?IResolvable | IResolvable | BootstrapActionConfigProperty[]A list of bootstrap actions to run before Hadoop starts on the cluster nodes.
configurations?IResolvable | IResolvable | ConfigurationProperty[]Applies only to Amazon EMR releases 4.x and later. The list of configurations that are supplied to the Amazon EMR cluster.
customAmiId?stringAvailable only in Amazon EMR releases 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.
ebsRootVolumeSize?numberThe size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is used for each Amazon EC2 instance.
kerberosAttributes?IResolvable | KerberosAttributesPropertyAttributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration.
logEncryptionKmsKeyId?stringThe AWS KMS key used for encrypting log files.
logUri?stringThe path to the Amazon S3 location where logs for this cluster are stored.
managedScalingPolicy?IResolvable | ManagedScalingPolicyPropertyCreates or updates a managed scaling policy for an Amazon EMR cluster.
osReleaseLabel?stringAWS::EMR::Cluster.OSReleaseLabel.
releaseLabel?stringThe Amazon EMR release label, which determines the version of open-source application packages installed on the cluster.
scaleDownBehavior?stringThe way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized.
securityConfiguration?stringThe name of the security configuration applied to the cluster.
stepConcurrencyLevel?numberSpecifies the number of steps that can be executed concurrently.
steps?IResolvable | IResolvable | StepConfigProperty[]A list of steps to run.
tags?CfnTag[]A list of tags associated with a cluster.
visibleToAllUsers?boolean | IResolvableIndicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster.

instances

Type: IResolvable | JobFlowInstancesConfigProperty

A specification of the number and type of Amazon EC2 instances.


jobFlowRole

Type: string

Also called instance profile and Amazon EC2 role.

An IAM role for an Amazon EMR cluster. The Amazon EC2 instances of the cluster assume this role. The default role is EMR_EC2_DefaultRole . In order to use the default role, you must have already created it using the AWS CLI or console.


name

Type: string

The name of the cluster.


serviceRole

Type: string

The IAM role that Amazon EMR assumes in order to access AWS resources on your behalf.


additionalInfo?

Type: any (optional)

A JSON string for selecting additional features.


applications?

Type: IResolvable | IResolvable | ApplicationProperty[] (optional)

The applications to install on this cluster, for example, Spark, Flink, Oozie, Zeppelin, and so on.


autoScalingRole?

Type: string (optional)

An IAM role for automatic scaling policies.

The default role is EMR_AutoScaling_DefaultRole . The IAM role provides permissions that the automatic scaling feature requires to launch and terminate Amazon EC2 instances in an instance group.


autoTerminationPolicy?

Type: IResolvable | AutoTerminationPolicyProperty (optional)

AWS::EMR::Cluster.AutoTerminationPolicy.


bootstrapActions?

Type: IResolvable | IResolvable | BootstrapActionConfigProperty[] (optional)

A list of bootstrap actions to run before Hadoop starts on the cluster nodes.


configurations?

Type: IResolvable | IResolvable | ConfigurationProperty[] (optional)

Applies only to Amazon EMR releases 4.x and later. The list of configurations that are supplied to the Amazon EMR cluster.


customAmiId?

Type: string (optional)

Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.


ebsRootVolumeSize?

Type: number (optional)

The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is used for each Amazon EC2 instance.

Available in Amazon EMR releases 4.x and later.


kerberosAttributes?

Type: IResolvable | KerberosAttributesProperty (optional)

Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration.

For more information see Use Kerberos Authentication in the Amazon EMR Management Guide .


logEncryptionKmsKeyId?

Type: string (optional)

The AWS KMS key used for encrypting log files.

This attribute is only available with Amazon EMR 5.30.0 and later, excluding Amazon EMR 6.0.0.


logUri?

Type: string (optional)

The path to the Amazon S3 location where logs for this cluster are stored.


managedScalingPolicy?

Type: IResolvable | ManagedScalingPolicyProperty (optional)

Creates or updates a managed scaling policy for an Amazon EMR cluster.

The managed scaling policy defines the limits for resources, such as Amazon EC2 instances that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration.


osReleaseLabel?

Type: string (optional)

AWS::EMR::Cluster.OSReleaseLabel.


releaseLabel?

Type: string (optional)

The Amazon EMR release label, which determines the version of open-source application packages installed on the cluster.

Release labels are in the form emr-x.x.x , where x.x.x is an Amazon EMR release version such as emr-5.14.0 . For more information about Amazon EMR release versions and included application versions and features, see . The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use AmiVersion .


scaleDownBehavior?

Type: string (optional)

The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized.

TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION is available only in Amazon EMR releases 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.


securityConfiguration?

Type: string (optional)

The name of the security configuration applied to the cluster.


stepConcurrencyLevel?

Type: number (optional)

Specifies the number of steps that can be executed concurrently.

The default value is 1 . The maximum value is 256 .


steps?

Type: IResolvable | IResolvable | StepConfigProperty[] (optional)

A list of steps to run.


tags?

Type: CfnTag[] (optional)

A list of tags associated with a cluster.


visibleToAllUsers?

Type: boolean | IResolvable (optional)

Indicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster.

If this value is set to true , all IAM users of that AWS account can view and manage the cluster if they have the proper policy permissions set. If this value is false , only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

When you create clusters directly through the EMR console or API, this value is set to true by default. However, for AWS::EMR::Cluster resources in CloudFormation, the default is false .