CfnClusterProps
- class aws_cdk.aws_emr.CfnClusterProps(*, instances, job_flow_role, name, service_role, additional_info=None, applications=None, auto_scaling_role=None, auto_termination_policy=None, bootstrap_actions=None, configurations=None, custom_ami_id=None, ebs_root_volume_size=None, kerberos_attributes=None, log_encryption_kms_key_id=None, log_uri=None, managed_scaling_policy=None, os_release_label=None, release_label=None, scale_down_behavior=None, security_configuration=None, step_concurrency_level=None, steps=None, tags=None, visible_to_all_users=None)
Bases:
object
Properties for defining a
CfnCluster
.- Parameters:
instances (
Union
[JobFlowInstancesConfigProperty
,Dict
[str
,Any
],IResolvable
]) – A specification of the number and type of Amazon EC2 instances.job_flow_role (
str
) – 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 isEMR_EC2_DefaultRole
. In order to use the default role, you must have already created it using the AWS CLI or console.name (
str
) – The name of the cluster.service_role (
str
) – The IAM role that Amazon EMR assumes in order to access AWS resources on your behalf.additional_info (
Optional
[Any
]) – A JSON string for selecting additional features.applications (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ApplicationProperty
,Dict
[str
,Any
]]],None
]) – The applications to install on this cluster, for example, Spark, Flink, Oozie, Zeppelin, and so on.auto_scaling_role (
Optional
[str
]) – An IAM role for automatic scaling policies. The default role isEMR_AutoScaling_DefaultRole
. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate Amazon EC2 instances in an instance group.auto_termination_policy (
Union
[IResolvable
,AutoTerminationPolicyProperty
,Dict
[str
,Any
],None
]) –AWS::EMR::Cluster.AutoTerminationPolicy
.bootstrap_actions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,BootstrapActionConfigProperty
,Dict
[str
,Any
]]],None
]) – A list of bootstrap actions to run before Hadoop starts on the cluster nodes.configurations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ConfigurationProperty
,Dict
[str
,Any
]]],None
]) – Applies only to Amazon EMR releases 4.x and later. The list of configurations that are supplied to the Amazon EMR cluster.custom_ami_id (
Optional
[str
]) – 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.ebs_root_volume_size (
Union
[int
,float
,None
]) – 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.kerberos_attributes (
Union
[IResolvable
,KerberosAttributesProperty
,Dict
[str
,Any
],None
]) – 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 .log_encryption_kms_key_id (
Optional
[str
]) – 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.log_uri (
Optional
[str
]) – The path to the Amazon S3 location where logs for this cluster are stored.managed_scaling_policy (
Union
[IResolvable
,ManagedScalingPolicyProperty
,Dict
[str
,Any
],None
]) – 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.os_release_label (
Optional
[str
]) –AWS::EMR::Cluster.OSReleaseLabel
.release_label (
Optional
[str
]) – The Amazon EMR release label, which determines the version of open-source application packages installed on the cluster. Release labels are in the formemr-x.x.x
, where x.x.x is an Amazon EMR release version such asemr-5.14.0
. For more information about Amazon EMR release versions and included application versions and features, see ` <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/>`_ . The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions useAmiVersion
.scale_down_behavior (
Optional
[str
]) – 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.security_configuration (
Optional
[str
]) – The name of the security configuration applied to the cluster.step_concurrency_level (
Union
[int
,float
,None
]) – Specifies the number of steps that can be executed concurrently. The default value is1
. The maximum value is256
.steps (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,StepConfigProperty
,Dict
[str
,Any
]]],None
]) – A list of steps to run.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – A list of tags associated with a cluster.visible_to_all_users (
Union
[bool
,IResolvable
,None
]) – Indicates whether the cluster is visible to all IAM users of the AWS account associated with the cluster. If this value is set totrue
, all IAM users of that AWS account can view and manage the cluster if they have the proper policy permissions set. If this value isfalse
, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action. .. epigraph:: When you create clusters directly through the EMR console or API, this value is set totrue
by default. However, forAWS::EMR::Cluster
resources in CloudFormation, the default isfalse
.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_emr as emr # additional_info: Any # configuration_property_: emr.CfnCluster.ConfigurationProperty cfn_cluster_props = emr.CfnClusterProps( instances=emr.CfnCluster.JobFlowInstancesConfigProperty( additional_master_security_groups=["additionalMasterSecurityGroups"], additional_slave_security_groups=["additionalSlaveSecurityGroups"], core_instance_fleet=emr.CfnCluster.InstanceFleetConfigProperty( instance_type_configs=[emr.CfnCluster.InstanceTypeConfigProperty( instance_type="instanceType", # the properties below are optional bid_price="bidPrice", bid_price_as_percentage_of_on_demand_price=123, configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_configuration=emr.CfnCluster.EbsConfigurationProperty( ebs_block_device_configs=[emr.CfnCluster.EbsBlockDeviceConfigProperty( volume_specification=emr.CfnCluster.VolumeSpecificationProperty( size_in_gb=123, volume_type="volumeType", # the properties below are optional iops=123 ), # the properties below are optional volumes_per_instance=123 )], ebs_optimized=False ), weighted_capacity=123 )], launch_specifications=emr.CfnCluster.InstanceFleetProvisioningSpecificationsProperty( on_demand_specification=emr.CfnCluster.OnDemandProvisioningSpecificationProperty( allocation_strategy="allocationStrategy" ), spot_specification=emr.CfnCluster.SpotProvisioningSpecificationProperty( timeout_action="timeoutAction", timeout_duration_minutes=123, # the properties below are optional allocation_strategy="allocationStrategy", block_duration_minutes=123 ) ), name="name", target_on_demand_capacity=123, target_spot_capacity=123 ), core_instance_group=emr.CfnCluster.InstanceGroupConfigProperty( instance_count=123, instance_type="instanceType", # the properties below are optional auto_scaling_policy=emr.CfnCluster.AutoScalingPolicyProperty( constraints=emr.CfnCluster.ScalingConstraintsProperty( max_capacity=123, min_capacity=123 ), rules=[emr.CfnCluster.ScalingRuleProperty( action=emr.CfnCluster.ScalingActionProperty( simple_scaling_policy_configuration=emr.CfnCluster.SimpleScalingPolicyConfigurationProperty( scaling_adjustment=123, # the properties below are optional adjustment_type="adjustmentType", cool_down=123 ), # the properties below are optional market="market" ), name="name", trigger=emr.CfnCluster.ScalingTriggerProperty( cloud_watch_alarm_definition=emr.CfnCluster.CloudWatchAlarmDefinitionProperty( comparison_operator="comparisonOperator", metric_name="metricName", period=123, threshold=123, # the properties below are optional dimensions=[emr.CfnCluster.MetricDimensionProperty( key="key", value="value" )], evaluation_periods=123, namespace="namespace", statistic="statistic", unit="unit" ) ), # the properties below are optional description="description" )] ), bid_price="bidPrice", configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_configuration=emr.CfnCluster.EbsConfigurationProperty( ebs_block_device_configs=[emr.CfnCluster.EbsBlockDeviceConfigProperty( volume_specification=emr.CfnCluster.VolumeSpecificationProperty( size_in_gb=123, volume_type="volumeType", # the properties below are optional iops=123 ), # the properties below are optional volumes_per_instance=123 )], ebs_optimized=False ), market="market", name="name" ), ec2_key_name="ec2KeyName", ec2_subnet_id="ec2SubnetId", ec2_subnet_ids=["ec2SubnetIds"], emr_managed_master_security_group="emrManagedMasterSecurityGroup", emr_managed_slave_security_group="emrManagedSlaveSecurityGroup", hadoop_version="hadoopVersion", keep_job_flow_alive_when_no_steps=False, master_instance_fleet=emr.CfnCluster.InstanceFleetConfigProperty( instance_type_configs=[emr.CfnCluster.InstanceTypeConfigProperty( instance_type="instanceType", # the properties below are optional bid_price="bidPrice", bid_price_as_percentage_of_on_demand_price=123, configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_configuration=emr.CfnCluster.EbsConfigurationProperty( ebs_block_device_configs=[emr.CfnCluster.EbsBlockDeviceConfigProperty( volume_specification=emr.CfnCluster.VolumeSpecificationProperty( size_in_gb=123, volume_type="volumeType", # the properties below are optional iops=123 ), # the properties below are optional volumes_per_instance=123 )], ebs_optimized=False ), weighted_capacity=123 )], launch_specifications=emr.CfnCluster.InstanceFleetProvisioningSpecificationsProperty( on_demand_specification=emr.CfnCluster.OnDemandProvisioningSpecificationProperty( allocation_strategy="allocationStrategy" ), spot_specification=emr.CfnCluster.SpotProvisioningSpecificationProperty( timeout_action="timeoutAction", timeout_duration_minutes=123, # the properties below are optional allocation_strategy="allocationStrategy", block_duration_minutes=123 ) ), name="name", target_on_demand_capacity=123, target_spot_capacity=123 ), master_instance_group=emr.CfnCluster.InstanceGroupConfigProperty( instance_count=123, instance_type="instanceType", # the properties below are optional auto_scaling_policy=emr.CfnCluster.AutoScalingPolicyProperty( constraints=emr.CfnCluster.ScalingConstraintsProperty( max_capacity=123, min_capacity=123 ), rules=[emr.CfnCluster.ScalingRuleProperty( action=emr.CfnCluster.ScalingActionProperty( simple_scaling_policy_configuration=emr.CfnCluster.SimpleScalingPolicyConfigurationProperty( scaling_adjustment=123, # the properties below are optional adjustment_type="adjustmentType", cool_down=123 ), # the properties below are optional market="market" ), name="name", trigger=emr.CfnCluster.ScalingTriggerProperty( cloud_watch_alarm_definition=emr.CfnCluster.CloudWatchAlarmDefinitionProperty( comparison_operator="comparisonOperator", metric_name="metricName", period=123, threshold=123, # the properties below are optional dimensions=[emr.CfnCluster.MetricDimensionProperty( key="key", value="value" )], evaluation_periods=123, namespace="namespace", statistic="statistic", unit="unit" ) ), # the properties below are optional description="description" )] ), bid_price="bidPrice", configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_configuration=emr.CfnCluster.EbsConfigurationProperty( ebs_block_device_configs=[emr.CfnCluster.EbsBlockDeviceConfigProperty( volume_specification=emr.CfnCluster.VolumeSpecificationProperty( size_in_gb=123, volume_type="volumeType", # the properties below are optional iops=123 ), # the properties below are optional volumes_per_instance=123 )], ebs_optimized=False ), market="market", name="name" ), placement=emr.CfnCluster.PlacementTypeProperty( availability_zone="availabilityZone" ), service_access_security_group="serviceAccessSecurityGroup", task_instance_fleets=[emr.CfnCluster.InstanceFleetConfigProperty( instance_type_configs=[emr.CfnCluster.InstanceTypeConfigProperty( instance_type="instanceType", # the properties below are optional bid_price="bidPrice", bid_price_as_percentage_of_on_demand_price=123, configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_configuration=emr.CfnCluster.EbsConfigurationProperty( ebs_block_device_configs=[emr.CfnCluster.EbsBlockDeviceConfigProperty( volume_specification=emr.CfnCluster.VolumeSpecificationProperty( size_in_gb=123, volume_type="volumeType", # the properties below are optional iops=123 ), # the properties below are optional volumes_per_instance=123 )], ebs_optimized=False ), weighted_capacity=123 )], launch_specifications=emr.CfnCluster.InstanceFleetProvisioningSpecificationsProperty( on_demand_specification=emr.CfnCluster.OnDemandProvisioningSpecificationProperty( allocation_strategy="allocationStrategy" ), spot_specification=emr.CfnCluster.SpotProvisioningSpecificationProperty( timeout_action="timeoutAction", timeout_duration_minutes=123, # the properties below are optional allocation_strategy="allocationStrategy", block_duration_minutes=123 ) ), name="name", target_on_demand_capacity=123, target_spot_capacity=123 )], task_instance_groups=[emr.CfnCluster.InstanceGroupConfigProperty( instance_count=123, instance_type="instanceType", # the properties below are optional auto_scaling_policy=emr.CfnCluster.AutoScalingPolicyProperty( constraints=emr.CfnCluster.ScalingConstraintsProperty( max_capacity=123, min_capacity=123 ), rules=[emr.CfnCluster.ScalingRuleProperty( action=emr.CfnCluster.ScalingActionProperty( simple_scaling_policy_configuration=emr.CfnCluster.SimpleScalingPolicyConfigurationProperty( scaling_adjustment=123, # the properties below are optional adjustment_type="adjustmentType", cool_down=123 ), # the properties below are optional market="market" ), name="name", trigger=emr.CfnCluster.ScalingTriggerProperty( cloud_watch_alarm_definition=emr.CfnCluster.CloudWatchAlarmDefinitionProperty( comparison_operator="comparisonOperator", metric_name="metricName", period=123, threshold=123, # the properties below are optional dimensions=[emr.CfnCluster.MetricDimensionProperty( key="key", value="value" )], evaluation_periods=123, namespace="namespace", statistic="statistic", unit="unit" ) ), # the properties below are optional description="description" )] ), bid_price="bidPrice", configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_configuration=emr.CfnCluster.EbsConfigurationProperty( ebs_block_device_configs=[emr.CfnCluster.EbsBlockDeviceConfigProperty( volume_specification=emr.CfnCluster.VolumeSpecificationProperty( size_in_gb=123, volume_type="volumeType", # the properties below are optional iops=123 ), # the properties below are optional volumes_per_instance=123 )], ebs_optimized=False ), market="market", name="name" )], termination_protected=False ), job_flow_role="jobFlowRole", name="name", service_role="serviceRole", # the properties below are optional additional_info=additional_info, applications=[emr.CfnCluster.ApplicationProperty( additional_info={ "additional_info_key": "additionalInfo" }, args=["args"], name="name", version="version" )], auto_scaling_role="autoScalingRole", auto_termination_policy=emr.CfnCluster.AutoTerminationPolicyProperty( idle_timeout=123 ), bootstrap_actions=[emr.CfnCluster.BootstrapActionConfigProperty( name="name", script_bootstrap_action=emr.CfnCluster.ScriptBootstrapActionConfigProperty( path="path", # the properties below are optional args=["args"] ) )], configurations=[emr.CfnCluster.ConfigurationProperty( classification="classification", configuration_properties={ "configuration_properties_key": "configurationProperties" }, configurations=[configuration_property_] )], custom_ami_id="customAmiId", ebs_root_volume_size=123, kerberos_attributes=emr.CfnCluster.KerberosAttributesProperty( kdc_admin_password="kdcAdminPassword", realm="realm", # the properties below are optional ad_domain_join_password="adDomainJoinPassword", ad_domain_join_user="adDomainJoinUser", cross_realm_trust_principal_password="crossRealmTrustPrincipalPassword" ), log_encryption_kms_key_id="logEncryptionKmsKeyId", log_uri="logUri", managed_scaling_policy=emr.CfnCluster.ManagedScalingPolicyProperty( compute_limits=emr.CfnCluster.ComputeLimitsProperty( maximum_capacity_units=123, minimum_capacity_units=123, unit_type="unitType", # the properties below are optional maximum_core_capacity_units=123, maximum_on_demand_capacity_units=123 ) ), os_release_label="osReleaseLabel", release_label="releaseLabel", scale_down_behavior="scaleDownBehavior", security_configuration="securityConfiguration", step_concurrency_level=123, steps=[emr.CfnCluster.StepConfigProperty( hadoop_jar_step=emr.CfnCluster.HadoopJarStepConfigProperty( jar="jar", # the properties below are optional args=["args"], main_class="mainClass", step_properties=[emr.CfnCluster.KeyValueProperty( key="key", value="value" )] ), name="name", # the properties below are optional action_on_failure="actionOnFailure" )], tags=[CfnTag( key="key", value="value" )], visible_to_all_users=False )
Attributes
- additional_info
A JSON string for selecting additional features.
- applications
The applications to install on this cluster, for example, Spark, Flink, Oozie, Zeppelin, and so on.
- auto_scaling_role
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.
- auto_termination_policy
AWS::EMR::Cluster.AutoTerminationPolicy
.
- bootstrap_actions
A list of bootstrap actions to run before Hadoop starts on the cluster nodes.
- configurations
Applies only to Amazon EMR releases 4.x and later. The list of configurations that are supplied to the Amazon EMR cluster.
- custom_ami_id
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.
- ebs_root_volume_size
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.
- instances
A specification of the number and type of Amazon EC2 instances.
- job_flow_role
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.
- kerberos_attributes
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 .
- log_encryption_kms_key_id
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.
- log_uri
The path to the Amazon S3 location where logs for this cluster are stored.
- managed_scaling_policy
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.
- name
The name of the cluster.
- os_release_label
AWS::EMR::Cluster.OSReleaseLabel
.
- release_label
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 asemr-5.14.0
. For more information about Amazon EMR release versions and included application versions and features, see ` <https://docs.aws.amazon.com/emr/latest/ReleaseGuide/>`_ . The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions useAmiVersion
.
- scale_down_behavior
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.
- security_configuration
The name of the security configuration applied to the cluster.
- service_role
The IAM role that Amazon EMR assumes in order to access AWS resources on your behalf.
- step_concurrency_level
Specifies the number of steps that can be executed concurrently.
The default value is
1
. The maximum value is256
.
- steps
A list of steps to run.
- tags
A list of tags associated with a cluster.
- visible_to_all_users
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 isfalse
, only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action. .. epigraph: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`` .