# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['Cluster']


class Cluster(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 additional_info: Optional[pulumi.Input[str]] = None,
                 applications: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 autoscaling_role: Optional[pulumi.Input[str]] = None,
                 bootstrap_actions: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterBootstrapActionArgs']]]]] = None,
                 configurations: Optional[pulumi.Input[str]] = None,
                 configurations_json: Optional[pulumi.Input[str]] = None,
                 core_instance_group: Optional[pulumi.Input[pulumi.InputType['ClusterCoreInstanceGroupArgs']]] = None,
                 custom_ami_id: Optional[pulumi.Input[str]] = None,
                 ebs_root_volume_size: Optional[pulumi.Input[float]] = None,
                 ec2_attributes: Optional[pulumi.Input[pulumi.InputType['ClusterEc2AttributesArgs']]] = None,
                 keep_job_flow_alive_when_no_steps: Optional[pulumi.Input[bool]] = None,
                 kerberos_attributes: Optional[pulumi.Input[pulumi.InputType['ClusterKerberosAttributesArgs']]] = None,
                 log_uri: Optional[pulumi.Input[str]] = None,
                 master_instance_group: Optional[pulumi.Input[pulumi.InputType['ClusterMasterInstanceGroupArgs']]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 release_label: Optional[pulumi.Input[str]] = None,
                 scale_down_behavior: Optional[pulumi.Input[str]] = None,
                 security_configuration: Optional[pulumi.Input[str]] = None,
                 service_role: Optional[pulumi.Input[str]] = None,
                 step_concurrency_level: Optional[pulumi.Input[float]] = None,
                 steps: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterStepArgs']]]]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 termination_protection: Optional[pulumi.Input[bool]] = None,
                 visible_to_all_users: Optional[pulumi.Input[bool]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Provides an Elastic MapReduce Cluster, a web service that makes it easy to
        process large amounts of data efficiently. See [Amazon Elastic MapReduce Documentation](https://aws.amazon.com/documentation/elastic-mapreduce/)
        for more information.

        To configure [Instance Groups](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for [task nodes](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-task), see the `emr.InstanceGroup` resource.

        > Support for [Instance Fleets](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-fleets) will be made available in an upcoming release.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aws as aws

        cluster = aws.emr.Cluster("cluster",
            release_label="emr-4.6.0",
            applications=["Spark"],
            additional_info=\"\"\"{
          "instanceAwsClientConfiguration": {
            "proxyPort": 8099,
            "proxyHost": "myproxy.example.com"
          }
        }
        \"\"\",
            termination_protection=False,
            keep_job_flow_alive_when_no_steps=True,
            ec2_attributes=aws.emr.ClusterEc2AttributesArgs(
                subnet_id=aws_subnet["main"]["id"],
                emr_managed_master_security_group=aws_security_group["sg"]["id"],
                emr_managed_slave_security_group=aws_security_group["sg"]["id"],
                instance_profile=aws_iam_instance_profile["emr_profile"]["arn"],
            ),
            master_instance_group=aws.emr.ClusterMasterInstanceGroupArgs(
                instance_type="m4.large",
            ),
            core_instance_group=aws.emr.ClusterCoreInstanceGroupArgs(
                instance_type="c4.large",
                instance_count=1,
                ebs_configs=[{
                    "size": "40",
                    "type": "gp2",
                    "volumesPerInstance": 1,
                }],
                bid_price="0.30",
                autoscaling_policy=\"\"\"{
        "Constraints": {
          "MinCapacity": 1,
          "MaxCapacity": 2
        },
        "Rules": [
          {
            "Name": "ScaleOutMemoryPercentage",
            "Description": "Scale out if YARNMemoryAvailablePercentage is less than 15",
            "Action": {
              "SimpleScalingPolicyConfiguration": {
                "AdjustmentType": "CHANGE_IN_CAPACITY",
                "ScalingAdjustment": 1,
                "CoolDown": 300
              }
            },
            "Trigger": {
              "CloudWatchAlarmDefinition": {
                "ComparisonOperator": "LESS_THAN",
                "EvaluationPeriods": 1,
                "MetricName": "YARNMemoryAvailablePercentage",
                "Namespace": "AWS/ElasticMapReduce",
                "Period": 300,
                "Statistic": "AVERAGE",
                "Threshold": 15.0,
                "Unit": "PERCENT"
              }
            }
          }
        ]
        }
        \"\"\",
            ),
            ebs_root_volume_size=100,
            tags={
                "role": "rolename",
                "env": "env",
            },
            bootstrap_actions=[aws.emr.ClusterBootstrapActionArgs(
                path="s3://elasticmapreduce/bootstrap-actions/run-if",
                name="runif",
                args=[
                    "instance.isMaster=true",
                    "echo running on master node",
                ],
            )],
            configurations_json=\"\"\"  [
            {
              "Classification": "hadoop-env",
              "Configurations": [
                {
                  "Classification": "export",
                  "Properties": {
                    "JAVA_HOME": "/usr/lib/jvm/java-1.8.0"
                  }
                }
              ],
              "Properties": {}
            },
            {
              "Classification": "spark-env",
              "Configurations": [
                {
                  "Classification": "export",
                  "Properties": {
                    "JAVA_HOME": "/usr/lib/jvm/java-1.8.0"
                  }
                }
              ],
              "Properties": {}
            }
          ]
        \"\"\",
            service_role=aws_iam_role["iam_emr_service_role"]["arn"])
        ```

        The `emr.Cluster` resource typically requires two IAM roles, one for the EMR Cluster
        to use as a service, and another to place on your Cluster Instances to interact
        with AWS from those instances. The suggested role policy template for the EMR service is `AmazonElasticMapReduceRole`,
        and `AmazonElasticMapReduceforEC2Role` for the EC2 profile. See the [Getting
        Started](https://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-gs-launch-sample-cluster.html)
        guide for more information on these IAM roles. There is also a fully-bootable
        example this provider configuration at the bottom of this page.
        ### Enable Debug Logging

        [Debug logging in EMR](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-debugging.html)
        is implemented as a step. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other
        steps are being managed outside of this provider.

        ```python
        import pulumi
        import pulumi_aws as aws

        # ... other configuration ...
        example = aws.emr.Cluster("example", steps=[aws.emr.ClusterStepArgs(
            action_on_failure="TERMINATE_CLUSTER",
            name="Setup Hadoop Debugging",
            hadoop_jar_step=aws.emr.ClusterStepHadoopJarStepArgs(
                jar="command-runner.jar",
                args=["state-pusher-script"],
            ),
        )])
        ```
        ### Multiple Node Master Instance Group

        Available in EMR version 5.23.0 and later, an EMR Cluster can be launched with three master nodes for high availability. Additional information about this functionality and its requirements can be found in the [EMR Management Guide](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-ha.html).

        ```python
        import pulumi
        import pulumi_aws as aws

        # This configuration is for illustrative purposes and highlights
        # only relevant configurations for working with this functionality.
        # Map public IP on launch must be enabled for public (Internet accessible) subnets
        # ... other configuration ...
        example_subnet = aws.ec2.Subnet("exampleSubnet", map_public_ip_on_launch=True)
        # ... other configuration ...
        example_cluster = aws.emr.Cluster("exampleCluster",
            release_label="emr-5.24.1",
            termination_protection=True,
            ec2_attributes=aws.emr.ClusterEc2AttributesArgs(
                subnet_id=example_subnet.id,
            ),
            master_instance_group=aws.emr.ClusterMasterInstanceGroupArgs(
                instance_count=3,
            ),
            core_instance_group=aws.emr.ClusterCoreInstanceGroupArgs())
        ```
        ## Example bootable config

        **NOTE:** This configuration demonstrates a minimal configuration needed to
        boot an example EMR Cluster. It is not meant to display best practices. Please
        use at your own risk.

        ```python
        import pulumi
        import pulumi_aws as aws

        main_vpc = aws.ec2.Vpc("mainVpc",
            cidr_block="168.31.0.0/16",
            enable_dns_hostnames=True,
            tags={
                "name": "emr_test",
            })
        main_subnet = aws.ec2.Subnet("mainSubnet",
            vpc_id=main_vpc.id,
            cidr_block="168.31.0.0/20",
            tags={
                "name": "emr_test",
            })
        # IAM role for EMR Service
        iam_emr_service_role = aws.iam.Role("iamEmrServiceRole", assume_role_policy=\"\"\"{
          "Version": "2008-10-17",
          "Statement": [
            {
              "Sid": "",
              "Effect": "Allow",
              "Principal": {
                "Service": "elasticmapreduce.amazonaws.com"
              },
              "Action": "sts:AssumeRole"
            }
          ]
        }
        \"\"\")
        # IAM Role for EC2 Instance Profile
        iam_emr_profile_role = aws.iam.Role("iamEmrProfileRole", assume_role_policy=\"\"\"{
          "Version": "2008-10-17",
          "Statement": [
            {
              "Sid": "",
              "Effect": "Allow",
              "Principal": {
                "Service": "ec2.amazonaws.com"
              },
              "Action": "sts:AssumeRole"
            }
          ]
        }
        \"\"\")
        emr_profile = aws.iam.InstanceProfile("emrProfile", role=iam_emr_profile_role.name)
        cluster = aws.emr.Cluster("cluster",
            release_label="emr-4.6.0",
            applications=["Spark"],
            ec2_attributes=aws.emr.ClusterEc2AttributesArgs(
                subnet_id=main_subnet.id,
                emr_managed_master_security_group=aws_security_group["allow_all"]["id"],
                emr_managed_slave_security_group=aws_security_group["allow_all"]["id"],
                instance_profile=emr_profile.arn,
            ),
            master_instance_group=aws.emr.ClusterMasterInstanceGroupArgs(
                instance_type="m5.xlarge",
            ),
            core_instance_group=aws.emr.ClusterCoreInstanceGroupArgs(
                instance_count=1,
                instance_type="m5.xlarge",
            ),
            tags={
                "role": "rolename",
                "dns_zone": "env_zone",
                "env": "env",
                "name": "name-env",
            },
            bootstrap_actions=[aws.emr.ClusterBootstrapActionArgs(
                path="s3://elasticmapreduce/bootstrap-actions/run-if",
                name="runif",
                args=[
                    "instance.isMaster=true",
                    "echo running on master node",
                ],
            )],
            configurations_json=\"\"\"  [
            {
              "Classification": "hadoop-env",
              "Configurations": [
                {
                  "Classification": "export",
                  "Properties": {
                    "JAVA_HOME": "/usr/lib/jvm/java-1.8.0"
                  }
                }
              ],
              "Properties": {}
            },
            {
              "Classification": "spark-env",
              "Configurations": [
                {
                  "Classification": "export",
                  "Properties": {
                    "JAVA_HOME": "/usr/lib/jvm/java-1.8.0"
                  }
                }
              ],
              "Properties": {}
            }
          ]
        \"\"\",
            service_role=iam_emr_service_role.arn)
        allow_access = aws.ec2.SecurityGroup("allowAccess",
            description="Allow inbound traffic",
            vpc_id=main_vpc.id,
            ingress=[aws.ec2.SecurityGroupIngressArgs(
                from_port=0,
                to_port=0,
                protocol="-1",
                cidr_blocks=main_vpc.cidr_block,
            )],
            egress=[aws.ec2.SecurityGroupEgressArgs(
                from_port=0,
                to_port=0,
                protocol="-1",
                cidr_blocks=["0.0.0.0/0"],
            )],
            tags={
                "name": "emr_test",
            },
            opts=ResourceOptions(depends_on=[main_subnet]))
        gw = aws.ec2.InternetGateway("gw", vpc_id=main_vpc.id)
        route_table = aws.ec2.RouteTable("routeTable",
            vpc_id=main_vpc.id,
            routes=[aws.ec2.RouteTableRouteArgs(
                cidr_block="0.0.0.0/0",
                gateway_id=gw.id,
            )])
        main_route_table_association = aws.ec2.MainRouteTableAssociation("mainRouteTableAssociation",
            vpc_id=main_vpc.id,
            route_table_id=route_table.id)
        ###
        iam_emr_service_policy = aws.iam.RolePolicy("iamEmrServicePolicy",
            role=iam_emr_service_role.id,
            policy=\"\"\"{
            "Version": "2012-10-17",
            "Statement": [{
                "Effect": "Allow",
                "Resource": "*",
                "Action": [
                    "ec2:AuthorizeSecurityGroupEgress",
                    "ec2:AuthorizeSecurityGroupIngress",
                    "ec2:CancelSpotInstanceRequests",
                    "ec2:CreateNetworkInterface",
                    "ec2:CreateSecurityGroup",
                    "ec2:CreateTags",
                    "ec2:DeleteNetworkInterface",
                    "ec2:DeleteSecurityGroup",
                    "ec2:DeleteTags",
                    "ec2:DescribeAvailabilityZones",
                    "ec2:DescribeAccountAttributes",
                    "ec2:DescribeDhcpOptions",
                    "ec2:DescribeInstanceStatus",
                    "ec2:DescribeInstances",
                    "ec2:DescribeKeyPairs",
                    "ec2:DescribeNetworkAcls",
                    "ec2:DescribeNetworkInterfaces",
                    "ec2:DescribePrefixLists",
                    "ec2:DescribeRouteTables",
                    "ec2:DescribeSecurityGroups",
                    "ec2:DescribeSpotInstanceRequests",
                    "ec2:DescribeSpotPriceHistory",
                    "ec2:DescribeSubnets",
                    "ec2:DescribeVpcAttribute",
                    "ec2:DescribeVpcEndpoints",
                    "ec2:DescribeVpcEndpointServices",
                    "ec2:DescribeVpcs",
                    "ec2:DetachNetworkInterface",
                    "ec2:ModifyImageAttribute",
                    "ec2:ModifyInstanceAttribute",
                    "ec2:RequestSpotInstances",
                    "ec2:RevokeSecurityGroupEgress",
                    "ec2:RunInstances",
                    "ec2:TerminateInstances",
                    "ec2:DeleteVolume",
                    "ec2:DescribeVolumeStatus",
                    "ec2:DescribeVolumes",
                    "ec2:DetachVolume",
                    "iam:GetRole",
                    "iam:GetRolePolicy",
                    "iam:ListInstanceProfiles",
                    "iam:ListRolePolicies",
                    "iam:PassRole",
                    "s3:CreateBucket",
                    "s3:Get*",
                    "s3:List*",
                    "sdb:BatchPutAttributes",
                    "sdb:Select",
                    "sqs:CreateQueue",
                    "sqs:Delete*",
                    "sqs:GetQueue*",
                    "sqs:PurgeQueue",
                    "sqs:ReceiveMessage"
                ]
            }]
        }
        \"\"\")
        iam_emr_profile_policy = aws.iam.RolePolicy("iamEmrProfilePolicy",
            role=iam_emr_profile_role.id,
            policy=\"\"\"{
            "Version": "2012-10-17",
            "Statement": [{
                "Effect": "Allow",
                "Resource": "*",
                "Action": [
                    "cloudwatch:*",
                    "dynamodb:*",
                    "ec2:Describe*",
                    "elasticmapreduce:Describe*",
                    "elasticmapreduce:ListBootstrapActions",
                    "elasticmapreduce:ListClusters",
                    "elasticmapreduce:ListInstanceGroups",
                    "elasticmapreduce:ListInstances",
                    "elasticmapreduce:ListSteps",
                    "kinesis:CreateStream",
                    "kinesis:DeleteStream",
                    "kinesis:DescribeStream",
                    "kinesis:GetRecords",
                    "kinesis:GetShardIterator",
                    "kinesis:MergeShards",
                    "kinesis:PutRecord",
                    "kinesis:SplitShard",
                    "rds:Describe*",
                    "s3:*",
                    "sdb:*",
                    "sns:*",
                    "sqs:*"
                ]
            }]
        }
        \"\"\")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] additional_info: A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
        :param pulumi.Input[List[pulumi.Input[str]]] applications: A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
        :param pulumi.Input[str] autoscaling_role: An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterBootstrapActionArgs']]]] bootstrap_actions: Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
        :param pulumi.Input[str] configurations: List of configurations supplied for the EMR cluster you are creating
        :param pulumi.Input[str] configurations_json: A JSON string for supplying list of configurations for the EMR cluster.
        :param pulumi.Input[pulumi.InputType['ClusterCoreInstanceGroupArgs']] core_instance_group: Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
        :param pulumi.Input[str] custom_ami_id: A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
        :param pulumi.Input[float] ebs_root_volume_size: Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
        :param pulumi.Input[pulumi.InputType['ClusterEc2AttributesArgs']] ec2_attributes: Attributes for the EC2 instances running the job flow. Defined below
        :param pulumi.Input[bool] keep_job_flow_alive_when_no_steps: Switch on/off run cluster with no steps or when all steps are complete (default is on)
        :param pulumi.Input[pulumi.InputType['ClusterKerberosAttributesArgs']] kerberos_attributes: Kerberos configuration for the cluster. Defined below
        :param pulumi.Input[str] log_uri: S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
        :param pulumi.Input[pulumi.InputType['ClusterMasterInstanceGroupArgs']] master_instance_group: Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
        :param pulumi.Input[str] name: The name of the step.
        :param pulumi.Input[str] release_label: The release label for the Amazon EMR release
        :param pulumi.Input[str] scale_down_behavior: The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
        :param pulumi.Input[str] security_configuration: The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `release_label` 4.8.0 or greater
        :param pulumi.Input[str] service_role: IAM role that will be assumed by the Amazon EMR service to access AWS resources
        :param pulumi.Input[float] step_concurrency_level: The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `release_label` 5.28.0 or greater. (default is 1)
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterStepArgs']]]] steps: List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: list of tags to apply to the EMR Cluster
        :param pulumi.Input[bool] termination_protection: Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
        :param pulumi.Input[bool] visible_to_all_users: Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            __props__['additional_info'] = additional_info
            __props__['applications'] = applications
            __props__['autoscaling_role'] = autoscaling_role
            __props__['bootstrap_actions'] = bootstrap_actions
            __props__['configurations'] = configurations
            __props__['configurations_json'] = configurations_json
            __props__['core_instance_group'] = core_instance_group
            __props__['custom_ami_id'] = custom_ami_id
            __props__['ebs_root_volume_size'] = ebs_root_volume_size
            __props__['ec2_attributes'] = ec2_attributes
            __props__['keep_job_flow_alive_when_no_steps'] = keep_job_flow_alive_when_no_steps
            __props__['kerberos_attributes'] = kerberos_attributes
            __props__['log_uri'] = log_uri
            __props__['master_instance_group'] = master_instance_group
            __props__['name'] = name
            if release_label is None:
                raise TypeError("Missing required property 'release_label'")
            __props__['release_label'] = release_label
            __props__['scale_down_behavior'] = scale_down_behavior
            __props__['security_configuration'] = security_configuration
            if service_role is None:
                raise TypeError("Missing required property 'service_role'")
            __props__['service_role'] = service_role
            __props__['step_concurrency_level'] = step_concurrency_level
            __props__['steps'] = steps
            __props__['tags'] = tags
            __props__['termination_protection'] = termination_protection
            __props__['visible_to_all_users'] = visible_to_all_users
            __props__['arn'] = None
            __props__['cluster_state'] = None
            __props__['master_public_dns'] = None
        super(Cluster, __self__).__init__(
            'aws:emr/cluster:Cluster',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            additional_info: Optional[pulumi.Input[str]] = None,
            applications: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            arn: Optional[pulumi.Input[str]] = None,
            autoscaling_role: Optional[pulumi.Input[str]] = None,
            bootstrap_actions: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterBootstrapActionArgs']]]]] = None,
            cluster_state: Optional[pulumi.Input[str]] = None,
            configurations: Optional[pulumi.Input[str]] = None,
            configurations_json: Optional[pulumi.Input[str]] = None,
            core_instance_group: Optional[pulumi.Input[pulumi.InputType['ClusterCoreInstanceGroupArgs']]] = None,
            custom_ami_id: Optional[pulumi.Input[str]] = None,
            ebs_root_volume_size: Optional[pulumi.Input[float]] = None,
            ec2_attributes: Optional[pulumi.Input[pulumi.InputType['ClusterEc2AttributesArgs']]] = None,
            keep_job_flow_alive_when_no_steps: Optional[pulumi.Input[bool]] = None,
            kerberos_attributes: Optional[pulumi.Input[pulumi.InputType['ClusterKerberosAttributesArgs']]] = None,
            log_uri: Optional[pulumi.Input[str]] = None,
            master_instance_group: Optional[pulumi.Input[pulumi.InputType['ClusterMasterInstanceGroupArgs']]] = None,
            master_public_dns: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            release_label: Optional[pulumi.Input[str]] = None,
            scale_down_behavior: Optional[pulumi.Input[str]] = None,
            security_configuration: Optional[pulumi.Input[str]] = None,
            service_role: Optional[pulumi.Input[str]] = None,
            step_concurrency_level: Optional[pulumi.Input[float]] = None,
            steps: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterStepArgs']]]]] = None,
            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
            termination_protection: Optional[pulumi.Input[bool]] = None,
            visible_to_all_users: Optional[pulumi.Input[bool]] = None) -> 'Cluster':
        """
        Get an existing Cluster resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] additional_info: A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
        :param pulumi.Input[List[pulumi.Input[str]]] applications: A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
        :param pulumi.Input[str] autoscaling_role: An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterBootstrapActionArgs']]]] bootstrap_actions: Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
        :param pulumi.Input[str] configurations: List of configurations supplied for the EMR cluster you are creating
        :param pulumi.Input[str] configurations_json: A JSON string for supplying list of configurations for the EMR cluster.
        :param pulumi.Input[pulumi.InputType['ClusterCoreInstanceGroupArgs']] core_instance_group: Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
        :param pulumi.Input[str] custom_ami_id: A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
        :param pulumi.Input[float] ebs_root_volume_size: Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
        :param pulumi.Input[pulumi.InputType['ClusterEc2AttributesArgs']] ec2_attributes: Attributes for the EC2 instances running the job flow. Defined below
        :param pulumi.Input[bool] keep_job_flow_alive_when_no_steps: Switch on/off run cluster with no steps or when all steps are complete (default is on)
        :param pulumi.Input[pulumi.InputType['ClusterKerberosAttributesArgs']] kerberos_attributes: Kerberos configuration for the cluster. Defined below
        :param pulumi.Input[str] log_uri: S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
        :param pulumi.Input[pulumi.InputType['ClusterMasterInstanceGroupArgs']] master_instance_group: Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
        :param pulumi.Input[str] master_public_dns: The public DNS name of the master EC2 instance.
               * `core_instance_group.0.id` - Core node type Instance Group ID, if using Instance Group for this node type.
        :param pulumi.Input[str] name: The name of the step.
        :param pulumi.Input[str] release_label: The release label for the Amazon EMR release
        :param pulumi.Input[str] scale_down_behavior: The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
        :param pulumi.Input[str] security_configuration: The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `release_label` 4.8.0 or greater
        :param pulumi.Input[str] service_role: IAM role that will be assumed by the Amazon EMR service to access AWS resources
        :param pulumi.Input[float] step_concurrency_level: The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `release_label` 5.28.0 or greater. (default is 1)
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ClusterStepArgs']]]] steps: List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: list of tags to apply to the EMR Cluster
        :param pulumi.Input[bool] termination_protection: Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
        :param pulumi.Input[bool] visible_to_all_users: Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["additional_info"] = additional_info
        __props__["applications"] = applications
        __props__["arn"] = arn
        __props__["autoscaling_role"] = autoscaling_role
        __props__["bootstrap_actions"] = bootstrap_actions
        __props__["cluster_state"] = cluster_state
        __props__["configurations"] = configurations
        __props__["configurations_json"] = configurations_json
        __props__["core_instance_group"] = core_instance_group
        __props__["custom_ami_id"] = custom_ami_id
        __props__["ebs_root_volume_size"] = ebs_root_volume_size
        __props__["ec2_attributes"] = ec2_attributes
        __props__["keep_job_flow_alive_when_no_steps"] = keep_job_flow_alive_when_no_steps
        __props__["kerberos_attributes"] = kerberos_attributes
        __props__["log_uri"] = log_uri
        __props__["master_instance_group"] = master_instance_group
        __props__["master_public_dns"] = master_public_dns
        __props__["name"] = name
        __props__["release_label"] = release_label
        __props__["scale_down_behavior"] = scale_down_behavior
        __props__["security_configuration"] = security_configuration
        __props__["service_role"] = service_role
        __props__["step_concurrency_level"] = step_concurrency_level
        __props__["steps"] = steps
        __props__["tags"] = tags
        __props__["termination_protection"] = termination_protection
        __props__["visible_to_all_users"] = visible_to_all_users
        return Cluster(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="additionalInfo")
    def additional_info(self) -> Optional[str]:
        """
        A JSON string for selecting additional features such as adding proxy information. Note: Currently there is no API to retrieve the value of this argument after EMR cluster creation from provider, therefore this provider cannot detect drift from the actual EMR cluster if its value is changed outside this provider.
        """
        return pulumi.get(self, "additional_info")

    @property
    @pulumi.getter
    def applications(self) -> Optional[List[str]]:
        """
        A list of applications for the cluster. Valid values are: `Flink`, `Hadoop`, `Hive`, `Mahout`, `Pig`, `Spark`, and `JupyterHub` (as of EMR 5.14.0). Case insensitive
        """
        return pulumi.get(self, "applications")

    @property
    @pulumi.getter
    def arn(self) -> str:
        return pulumi.get(self, "arn")

    @property
    @pulumi.getter(name="autoscalingRole")
    def autoscaling_role(self) -> Optional[str]:
        """
        An IAM role for automatic scaling policies. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
        """
        return pulumi.get(self, "autoscaling_role")

    @property
    @pulumi.getter(name="bootstrapActions")
    def bootstrap_actions(self) -> Optional[List['outputs.ClusterBootstrapAction']]:
        """
        Ordered list of bootstrap actions that will be run before Hadoop is started on the cluster nodes. Defined below.
        """
        return pulumi.get(self, "bootstrap_actions")

    @property
    @pulumi.getter(name="clusterState")
    def cluster_state(self) -> str:
        return pulumi.get(self, "cluster_state")

    @property
    @pulumi.getter
    def configurations(self) -> Optional[str]:
        """
        List of configurations supplied for the EMR cluster you are creating
        """
        return pulumi.get(self, "configurations")

    @property
    @pulumi.getter(name="configurationsJson")
    def configurations_json(self) -> Optional[str]:
        """
        A JSON string for supplying list of configurations for the EMR cluster.
        """
        return pulumi.get(self, "configurations_json")

    @property
    @pulumi.getter(name="coreInstanceGroup")
    def core_instance_group(self) -> 'outputs.ClusterCoreInstanceGroup':
        """
        Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [core node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-core).
        """
        return pulumi.get(self, "core_instance_group")

    @property
    @pulumi.getter(name="customAmiId")
    def custom_ami_id(self) -> Optional[str]:
        """
        A custom Amazon Linux AMI for the cluster (instead of an EMR-owned AMI). Available in Amazon EMR version 5.7.0 and later.
        """
        return pulumi.get(self, "custom_ami_id")

    @property
    @pulumi.getter(name="ebsRootVolumeSize")
    def ebs_root_volume_size(self) -> Optional[float]:
        """
        Size in GiB of the EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
        """
        return pulumi.get(self, "ebs_root_volume_size")

    @property
    @pulumi.getter(name="ec2Attributes")
    def ec2_attributes(self) -> Optional['outputs.ClusterEc2Attributes']:
        """
        Attributes for the EC2 instances running the job flow. Defined below
        """
        return pulumi.get(self, "ec2_attributes")

    @property
    @pulumi.getter(name="keepJobFlowAliveWhenNoSteps")
    def keep_job_flow_alive_when_no_steps(self) -> bool:
        """
        Switch on/off run cluster with no steps or when all steps are complete (default is on)
        """
        return pulumi.get(self, "keep_job_flow_alive_when_no_steps")

    @property
    @pulumi.getter(name="kerberosAttributes")
    def kerberos_attributes(self) -> Optional['outputs.ClusterKerberosAttributes']:
        """
        Kerberos configuration for the cluster. Defined below
        """
        return pulumi.get(self, "kerberos_attributes")

    @property
    @pulumi.getter(name="logUri")
    def log_uri(self) -> Optional[str]:
        """
        S3 bucket to write the log files of the job flow. If a value is not provided, logs are not created
        """
        return pulumi.get(self, "log_uri")

    @property
    @pulumi.getter(name="masterInstanceGroup")
    def master_instance_group(self) -> 'outputs.ClusterMasterInstanceGroup':
        """
        Configuration block to use an [Instance Group](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-group-configuration.html#emr-plan-instance-groups) for the [master node type](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-master-core-task-nodes.html#emr-plan-master).
        """
        return pulumi.get(self, "master_instance_group")

    @property
    @pulumi.getter(name="masterPublicDns")
    def master_public_dns(self) -> str:
        """
        The public DNS name of the master EC2 instance.
        * `core_instance_group.0.id` - Core node type Instance Group ID, if using Instance Group for this node type.
        """
        return pulumi.get(self, "master_public_dns")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The name of the step.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="releaseLabel")
    def release_label(self) -> str:
        """
        The release label for the Amazon EMR release
        """
        return pulumi.get(self, "release_label")

    @property
    @pulumi.getter(name="scaleDownBehavior")
    def scale_down_behavior(self) -> str:
        """
        The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an `instance group` is resized.
        """
        return pulumi.get(self, "scale_down_behavior")

    @property
    @pulumi.getter(name="securityConfiguration")
    def security_configuration(self) -> Optional[str]:
        """
        The security configuration name to attach to the EMR cluster. Only valid for EMR clusters with `release_label` 4.8.0 or greater
        """
        return pulumi.get(self, "security_configuration")

    @property
    @pulumi.getter(name="serviceRole")
    def service_role(self) -> str:
        """
        IAM role that will be assumed by the Amazon EMR service to access AWS resources
        """
        return pulumi.get(self, "service_role")

    @property
    @pulumi.getter(name="stepConcurrencyLevel")
    def step_concurrency_level(self) -> Optional[float]:
        """
        The number of steps that can be executed concurrently. You can specify a maximum of 256 steps. Only valid for EMR clusters with `release_label` 5.28.0 or greater. (default is 1)
        """
        return pulumi.get(self, "step_concurrency_level")

    @property
    @pulumi.getter
    def steps(self) -> List['outputs.ClusterStep']:
        """
        List of steps to run when creating the cluster. Defined below. It is highly recommended to utilize [`ignoreChanges`](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) if other steps are being managed outside of this provider.
        """
        return pulumi.get(self, "steps")

    @property
    @pulumi.getter
    def tags(self) -> Optional[Mapping[str, str]]:
        """
        list of tags to apply to the EMR Cluster
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="terminationProtection")
    def termination_protection(self) -> bool:
        """
        Switch on/off termination protection (default is `false`, except when using multiple master nodes). Before attempting to destroy the resource when termination protection is enabled, this configuration must be applied with its value set to `false`.
        """
        return pulumi.get(self, "termination_protection")

    @property
    @pulumi.getter(name="visibleToAllUsers")
    def visible_to_all_users(self) -> Optional[bool]:
        """
        Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. Default `true`
        """
        return pulumi.get(self, "visible_to_all_users")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

