aws-cdk-lib.aws_emr.CfnCluster

class CfnCluster (construct)

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

Implements IConstruct, IDependable, IInspectable

A CloudFormation AWS::EMR::Cluster.

The AWS::EMR::Cluster resource specifies an Amazon EMR cluster. This cluster is a collection of Amazon EC2 instances that run open source big data frameworks and applications to process and analyze vast amounts of data. For more information, see the Amazon EMR Management Guide .

Amazon EMR now supports launching task instance groups and task instance fleets as part of the AWS::EMR::Cluster resource. This can be done by using the JobFlowInstancesConfig property type's TaskInstanceGroups and TaskInstanceFleets subproperties. Using these subproperties reduces delays in provisioning task nodes compared to specifying task nodes with the AWS::EMR::InstanceGroupConfig and AWS::EMR::InstanceFleetConfig resources. Please refer to the examples at the bottom of this page to learn how to use these subproperties.

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 cfnCluster = new emr.CfnCluster(this, 'MyCfnCluster', {
  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,
});

Initializer

new CfnCluster(scope: Construct, id: string, props: CfnClusterProps)

Parameters

  • scope Construct — - scope in which this resource is defined.
  • id string — - scoped id of the resource.
  • props CfnClusterProps — - resource properties.

Create a new AWS::EMR::Cluster.

Construct Props

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 .

Properties

NameTypeDescription
additionalInfoanyA JSON string for selecting additional features.
attrMasterPublicDnsstringThe public DNS name of the master node (instance), such as ec2-12-123-123-123.us-west-2.compute.amazonaws.com .
cfnOptionsICfnResourceOptionsOptions for this resource, such as condition, update policy etc.
cfnProperties{ [string]: any }
cfnResourceTypestringAWS resource type.
creationStackstring[]
instancesIResolvable | JobFlowInstancesConfigPropertyA specification of the number and type of Amazon EC2 instances.
jobFlowRolestringAlso called instance profile and Amazon EC2 role.
logicalIdstringThe logical ID for this CloudFormation stack element.
namestringThe name of the cluster.
nodeNodeThe tree node.
refstringReturn a string that will be resolved to a CloudFormation { Ref } for this element.
serviceRolestringThe IAM role that Amazon EMR assumes in order to access AWS resources on your behalf.
stackStackThe stack in which this element is defined.
tagsTagManagerA list of tags associated with a cluster.
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.
visibleToAllUsers?boolean | IResolvableIndicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster.
static CFN_RESOURCE_TYPE_NAMEstringThe CloudFormation resource type name for this resource class.

additionalInfo

Type: any

A JSON string for selecting additional features.


attrMasterPublicDns

Type: string

The public DNS name of the master node (instance), such as ec2-12-123-123-123.us-west-2.compute.amazonaws.com .


cfnOptions

Type: ICfnResourceOptions

Options for this resource, such as condition, update policy etc.


cfnProperties

Type: { [string]: any }


cfnResourceType

Type: string

AWS resource type.


creationStack

Type: string[]


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.


logicalId

Type: string

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).


name

Type: string

The name of the cluster.


node

Type: Node

The tree node.


ref

Type: string

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).


serviceRole

Type: string

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


stack

Type: Stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).


tags

Type: TagManager

A list of tags associated with a cluster.


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.


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 .


static CFN_RESOURCE_TYPE_NAME

Type: string

The CloudFormation resource type name for this resource class.

Methods

NameDescription
addDeletionOverride(path)Syntactic sugar for addOverride(path, undefined).
addDependency(target)Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addDependsOn(target)⚠️Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)Add a value to the CloudFormation Resource Metadata.
addOverride(path, value)Adds an override to the synthesized CloudFormation resource.
addPropertyDeletionOverride(propertyPath)Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)Adds an override to a resource property.
applyRemovalPolicy(policy?, options?)Sets the deletion policy of the resource based on the removal policy specified.
getAtt(attributeName, typeHint?)Returns a token for an runtime attribute of this resource.
getMetadata(key)Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector)Examines the CloudFormation resource and discloses attributes.
obtainDependencies()Retrieves an array of resources this resource depends on.
obtainResourceDependencies()Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)Indicates that this resource no longer depends on another resource.
replaceDependency(target, newTarget)Replaces one dependency with another.
toString()Returns a string representation of this construct.
protected renderProperties(props)

addDeletionOverride(path)

public addDeletionOverride(path: string): void

Parameters

  • path string — The path of the value to delete.

Syntactic sugar for addOverride(path, undefined).


addDependency(target)

public addDependency(target: CfnResource): void

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.


addDependsOn(target)⚠️

public addDependsOn(target: CfnResource): void

⚠️ Deprecated: use addDependency

Parameters

  • target CfnResource

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.


addMetadata(key, value)

public addMetadata(key: string, value: any): void

Parameters

  • key string
  • value any

Add a value to the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


addOverride(path, value)

public addOverride(path: string, value: any): void

Parameters

  • path string — - The path of the property, you can use dot notation to override values in complex types.
  • value any — - The value.

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.


addPropertyDeletionOverride(propertyPath)

public addPropertyDeletionOverride(propertyPath: string): void

Parameters

  • propertyPath string — The path to the property.

Adds an override that deletes the value of a property from the resource definition.


addPropertyOverride(propertyPath, value)

public addPropertyOverride(propertyPath: string, value: any): void

Parameters

  • propertyPath string — The path of the property.
  • value any — The value.

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).


applyRemovalPolicy(policy?, options?)

public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void

Parameters

  • policy RemovalPolicy
  • options RemovalPolicyOptions

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options


getAtt(attributeName, typeHint?)

public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference

Parameters

  • attributeName string — The name of the attribute.
  • typeHint ResolutionTypeHint

Returns

  • Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.


getMetadata(key)

public getMetadata(key: string): any

Parameters

  • key string

Returns

  • any

Retrieve a value value from the CloudFormation Resource Metadata.

See also: [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)


inspect(inspector)

public inspect(inspector: TreeInspector): void

Parameters

  • inspector TreeInspector — - tree inspector to collect and process attributes.

Examines the CloudFormation resource and discloses attributes.


obtainDependencies()

public obtainDependencies(): Stack &#124; CfnResource[]

Returns

  • Stack | CfnResource[]

Retrieves an array of resources this resource depends on.

This assembles dependencies on resources across stacks (including nested stacks) automatically.


obtainResourceDependencies()

public obtainResourceDependencies(): CfnResource[]

Returns

  • CfnResource[]

Get a shallow copy of dependencies between this resource and other resources in the same stack.


overrideLogicalId(newLogicalId)

public overrideLogicalId(newLogicalId: string): void

Parameters

  • newLogicalId string — The new logical ID to use for this stack element.

Overrides the auto-generated logical ID with a specific ID.


removeDependency(target)

public removeDependency(target: CfnResource): void

Parameters

  • target CfnResource

Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.


replaceDependency(target, newTarget)

public replaceDependency(target: CfnResource, newTarget: CfnResource): void

Parameters

  • target CfnResource — The dependency to replace.
  • newTarget CfnResource — The new dependency to add.

Replaces one dependency with another.


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


protected renderProperties(props)

protected renderProperties(props: { [string]: any }): { [string]: any }

Parameters

  • props { [string]: any }

Returns

  • { [string]: any }