Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

Cluster

Provides a EMR Cluster resource. With this you can create, read, and release EMR Cluster.

NOTE: Available in 1.57.0+.

Example Usage

1. Create A Cluster

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultMainVersions = Output.Create(AliCloud.Emr.GetMainVersions.InvokeAsync());
        var defaultInstanceTypes = defaultMainVersions.Apply(defaultMainVersions => Output.Create(AliCloud.Emr.GetInstanceTypes.InvokeAsync(new AliCloud.Emr.GetInstanceTypesArgs
        {
            DestinationResource = "InstanceType",
            ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
            SupportLocalStorage = false,
            InstanceChargeType = "PostPaid",
            SupportNodeTypes = 
            {
                "MASTER",
                "CORE",
                "TASK",
            },
        })));
        var dataDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "DataDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var systemDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "SystemDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var vpc = new List<AliCloud.Vpc.Network>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new AliCloud.Vpc.NetworkArgs
            {
                CidrBlock = @var.Vpc_cidr,
            }));
        }
        var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
        for (var rangeIndex = 0; rangeIndex < (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new AliCloud.Ecs.SecurityGroupArgs
            {
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // VSwitch Resource for Module
        var vswitch = new List<AliCloud.Vpc.Switch>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new AliCloud.Vpc.SwitchArgs
            {
                AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId) : @var.Availability_zone,
                VswitchName = @var.Vswitch_name,
                CidrBlock = @var.Vswitch_cidr,
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // Ram role Resource for Module
        var defaultRole = new AliCloud.Ram.Role("defaultRole", new AliCloud.Ram.RoleArgs
        {
            Document = @"    {
        ""Statement"": [
        {
            ""Action"": ""sts:AssumeRole"",
            ""Effect"": ""Allow"",
            ""Principal"": {
            ""Service"": [
                ""emr.aliyuncs.com"",
                ""ecs.aliyuncs.com""
            ]
            }
        }
        ],
        ""Version"": ""1""
    }
",
            Description = "this is a role test.",
            Force = true,
        });
        var defaultCluster = new AliCloud.Emr.Cluster("defaultCluster", new AliCloud.Emr.ClusterArgs
        {
            EmrVer = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.EmrVersion),
            ClusterType = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0]),
            HostGroups = 
            {
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "master_group",
                    HostGroupType = "MASTER",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "1",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "core_group",
                    HostGroupType = "CORE",
                    NodeCount = "3",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "4",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "task_group",
                    HostGroupType = "TASK",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "4",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
            },
            HighAvailabilityEnable = true,
            ZoneId = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId),
            SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
            IsOpenPublicIp = true,
            ChargeType = "PostPaid",
            VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
            UserDefinedEmrEcsRole = defaultRole.Name,
            SshEnable = true,
            MasterPwd = "ABCtest1234!",
        });
    }

}

Coming soon!

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

default_main_versions = alicloud.emr.get_main_versions()
default_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    support_local_storage=False,
    instance_charge_type="PostPaid",
    support_node_types=[
        "MASTER",
        "CORE",
        "TASK",
    ])
data_disk = alicloud.emr.get_disk_types(destination_resource="DataDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if var.vpc_id ==  else 0 == True)]:
    vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}", cidr_block=var["vpc_cidr"]))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if var.security_group_id ==  else 0 == True)]:
    default_security_group.append(alicloud.ecs.SecurityGroup(f"defaultSecurityGroup-{range['value']}", vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if var.vswitch_id ==  else 0 == True)]:
    vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
        availability_zone=default_instance_types.types[0].zone_id if var["availability_zone"] == "" else var["availability_zone"],
        vswitch_name=var["vswitch_name"],
        cidr_block=var["vswitch_cidr"],
        vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# Ram role Resource for Module
default_role = alicloud.ram.Role("defaultRole",
    document="""    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
""",
    description="this is a role test.",
    force=True)
default_cluster = alicloud.emr.Cluster("defaultCluster",
    emr_ver=default_main_versions.main_versions[0].emr_version,
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    host_groups=[
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="master_group",
            host_group_type="MASTER",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="1",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="core_group",
            host_group_type="CORE",
            node_count="3",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="4",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="task_group",
            host_group_type="TASK",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="4",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
    ],
    high_availability_enable=True,
    zone_id=default_instance_types.types[0].zone_id,
    security_group_id=default_security_group.id if var["security_group_id"] == "" else var["security_group_id"],
    is_open_public_ip=True,
    charge_type="PostPaid",
    vswitch_id=vswitch.id if var["vswitch_id"] == "" else var["vswitch_id"],
    user_defined_emr_ecs_role=default_role.name,
    ssh_enable=True,
    master_pwd="ABCtest1234!")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultMainVersions = alicloud.emr.getMainVersions({});
const defaultInstanceTypes = defaultMainVersions.then(defaultMainVersions => alicloud.emr.getInstanceTypes({
    destinationResource: "InstanceType",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    supportLocalStorage: false,
    instanceChargeType: "PostPaid",
    supportNodeTypes: [
        "MASTER",
        "CORE",
        "TASK",
    ],
}));
const dataDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "DataDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const systemDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "SystemDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[];
for (const range = {value: 0}; range.value < (_var.vpc_id == "" ? 1 : 0 == true); range.value++) {
    vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {cidrBlock: _var.vpc_cidr}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[];
for (const range = {value: 0}; range.value < (_var.security_group_id == "" ? 1 : 0 == true); range.value++) {
    defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`defaultSecurityGroup-${range.value}`, {vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[];
for (const range = {value: 0}; range.value < (_var.vswitch_id == "" ? 1 : 0 == true); range.value++) {
    vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
        availabilityZone: _var.availability_zone == "" ? defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId) : _var.availability_zone,
        vswitchName: _var.vswitch_name,
        cidrBlock: _var.vswitch_cidr,
        vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id,
    }));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("defaultRole", {
    document: `    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
`,
    description: "this is a role test.",
    force: true,
});
const defaultCluster = new alicloud.emr.Cluster("defaultCluster", {
    emrVer: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.emrVersion),
    clusterType: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.clusterTypes?[0]),
    hostGroups: [
        {
            hostGroupName: "master_group",
            hostGroupType: "MASTER",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "1",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
        {
            hostGroupName: "core_group",
            hostGroupType: "CORE",
            nodeCount: "3",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "4",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
        {
            hostGroupName: "task_group",
            hostGroupType: "TASK",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "4",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
    ],
    highAvailabilityEnable: true,
    zoneId: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId),
    securityGroupId: _var.security_group_id == "" ? defaultSecurityGroup.id : _var.security_group_id,
    isOpenPublicIp: true,
    chargeType: "PostPaid",
    vswitchId: _var.vswitch_id == "" ? vswitch.id : _var.vswitch_id,
    userDefinedEmrEcsRole: defaultRole.name,
    sshEnable: true,
    masterPwd: "ABCtest1234!",
});

Coming soon!

2. Scale Up

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultMainVersions = Output.Create(AliCloud.Emr.GetMainVersions.InvokeAsync());
        var defaultInstanceTypes = defaultMainVersions.Apply(defaultMainVersions => Output.Create(AliCloud.Emr.GetInstanceTypes.InvokeAsync(new AliCloud.Emr.GetInstanceTypesArgs
        {
            DestinationResource = "InstanceType",
            ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
            SupportLocalStorage = false,
            InstanceChargeType = "PostPaid",
            SupportNodeTypes = 
            {
                "MASTER",
                "CORE",
                "TASK",
            },
        })));
        var dataDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "DataDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var systemDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "SystemDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var vpc = new List<AliCloud.Vpc.Network>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new AliCloud.Vpc.NetworkArgs
            {
                CidrBlock = @var.Vpc_cidr,
            }));
        }
        var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
        for (var rangeIndex = 0; rangeIndex < (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new AliCloud.Ecs.SecurityGroupArgs
            {
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // VSwitch Resource for Module
        var vswitch = new List<AliCloud.Vpc.Switch>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new AliCloud.Vpc.SwitchArgs
            {
                AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId) : @var.Availability_zone,
                VswitchName = @var.Vswitch_name,
                CidrBlock = @var.Vswitch_cidr,
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // Ram role Resource for Module
        var defaultRole = new AliCloud.Ram.Role("defaultRole", new AliCloud.Ram.RoleArgs
        {
            Document = @"    {
        ""Statement"": [
        {
            ""Action"": ""sts:AssumeRole"",
            ""Effect"": ""Allow"",
            ""Principal"": {
            ""Service"": [
                ""emr.aliyuncs.com"",
                ""ecs.aliyuncs.com""
            ]
            }
        }
        ],
        ""Version"": ""1""
    }
",
            Description = "this is a role test.",
            Force = true,
        });
        var defaultCluster = new AliCloud.Emr.Cluster("defaultCluster", new AliCloud.Emr.ClusterArgs
        {
            EmrVer = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.EmrVersion),
            ClusterType = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0]),
            HostGroups = 
            {
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "master_group",
                    HostGroupType = "MASTER",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "1",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "core_group",
                    HostGroupType = "CORE",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "4",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "task_group",
                    HostGroupType = "TASK",
                    NodeCount = "4",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "4",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
            },
            HighAvailabilityEnable = true,
            ZoneId = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId),
            SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
            IsOpenPublicIp = true,
            ChargeType = "PostPaid",
            VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
            UserDefinedEmrEcsRole = defaultRole.Name,
            SshEnable = true,
            MasterPwd = "ABCtest1234!",
        });
    }

}

Coming soon!

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

default_main_versions = alicloud.emr.get_main_versions()
default_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    support_local_storage=False,
    instance_charge_type="PostPaid",
    support_node_types=[
        "MASTER",
        "CORE",
        "TASK",
    ])
data_disk = alicloud.emr.get_disk_types(destination_resource="DataDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if var.vpc_id ==  else 0 == True)]:
    vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}", cidr_block=var["vpc_cidr"]))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if var.security_group_id ==  else 0 == True)]:
    default_security_group.append(alicloud.ecs.SecurityGroup(f"defaultSecurityGroup-{range['value']}", vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if var.vswitch_id ==  else 0 == True)]:
    vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
        availability_zone=default_instance_types.types[0].zone_id if var["availability_zone"] == "" else var["availability_zone"],
        vswitch_name=var["vswitch_name"],
        cidr_block=var["vswitch_cidr"],
        vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# Ram role Resource for Module
default_role = alicloud.ram.Role("defaultRole",
    document="""    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
""",
    description="this is a role test.",
    force=True)
default_cluster = alicloud.emr.Cluster("defaultCluster",
    emr_ver=default_main_versions.main_versions[0].emr_version,
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    host_groups=[
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="master_group",
            host_group_type="MASTER",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="1",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="core_group",
            host_group_type="CORE",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="4",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="task_group",
            host_group_type="TASK",
            node_count="4",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="4",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
    ],
    high_availability_enable=True,
    zone_id=default_instance_types.types[0].zone_id,
    security_group_id=default_security_group.id if var["security_group_id"] == "" else var["security_group_id"],
    is_open_public_ip=True,
    charge_type="PostPaid",
    vswitch_id=vswitch.id if var["vswitch_id"] == "" else var["vswitch_id"],
    user_defined_emr_ecs_role=default_role.name,
    ssh_enable=True,
    master_pwd="ABCtest1234!")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultMainVersions = alicloud.emr.getMainVersions({});
const defaultInstanceTypes = defaultMainVersions.then(defaultMainVersions => alicloud.emr.getInstanceTypes({
    destinationResource: "InstanceType",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    supportLocalStorage: false,
    instanceChargeType: "PostPaid",
    supportNodeTypes: [
        "MASTER",
        "CORE",
        "TASK",
    ],
}));
const dataDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "DataDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const systemDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "SystemDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[];
for (const range = {value: 0}; range.value < (_var.vpc_id == "" ? 1 : 0 == true); range.value++) {
    vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {cidrBlock: _var.vpc_cidr}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[];
for (const range = {value: 0}; range.value < (_var.security_group_id == "" ? 1 : 0 == true); range.value++) {
    defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`defaultSecurityGroup-${range.value}`, {vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[];
for (const range = {value: 0}; range.value < (_var.vswitch_id == "" ? 1 : 0 == true); range.value++) {
    vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
        availabilityZone: _var.availability_zone == "" ? defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId) : _var.availability_zone,
        vswitchName: _var.vswitch_name,
        cidrBlock: _var.vswitch_cidr,
        vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id,
    }));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("defaultRole", {
    document: `    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
`,
    description: "this is a role test.",
    force: true,
});
const defaultCluster = new alicloud.emr.Cluster("defaultCluster", {
    emrVer: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.emrVersion),
    clusterType: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.clusterTypes?[0]),
    hostGroups: [
        {
            hostGroupName: "master_group",
            hostGroupType: "MASTER",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "1",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
        {
            hostGroupName: "core_group",
            hostGroupType: "CORE",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "4",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
        {
            hostGroupName: "task_group",
            hostGroupType: "TASK",
            nodeCount: "4",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "4",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
    ],
    highAvailabilityEnable: true,
    zoneId: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId),
    securityGroupId: _var.security_group_id == "" ? defaultSecurityGroup.id : _var.security_group_id,
    isOpenPublicIp: true,
    chargeType: "PostPaid",
    vswitchId: _var.vswitch_id == "" ? vswitch.id : _var.vswitch_id,
    userDefinedEmrEcsRole: defaultRole.name,
    sshEnable: true,
    masterPwd: "ABCtest1234!",
});

Coming soon!

3. Scale Down

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultMainVersions = Output.Create(AliCloud.Emr.GetMainVersions.InvokeAsync());
        var defaultInstanceTypes = defaultMainVersions.Apply(defaultMainVersions => Output.Create(AliCloud.Emr.GetInstanceTypes.InvokeAsync(new AliCloud.Emr.GetInstanceTypesArgs
        {
            DestinationResource = "InstanceType",
            ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
            SupportLocalStorage = false,
            InstanceChargeType = "PostPaid",
            SupportNodeTypes = 
            {
                "MASTER",
                "CORE",
                "TASK",
            },
        })));
        var dataDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "DataDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var systemDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "SystemDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var vpc = new List<AliCloud.Vpc.Network>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new AliCloud.Vpc.NetworkArgs
            {
                CidrBlock = @var.Vpc_cidr,
            }));
        }
        var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
        for (var rangeIndex = 0; rangeIndex < (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new AliCloud.Ecs.SecurityGroupArgs
            {
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // VSwitch Resource for Module
        var vswitch = new List<AliCloud.Vpc.Switch>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new AliCloud.Vpc.SwitchArgs
            {
                AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId) : @var.Availability_zone,
                VswitchName = @var.Vswitch_name,
                CidrBlock = @var.Vswitch_cidr,
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // Ram role Resource for Module
        var defaultRole = new AliCloud.Ram.Role("defaultRole", new AliCloud.Ram.RoleArgs
        {
            Document = @"    {
        ""Statement"": [
        {
            ""Action"": ""sts:AssumeRole"",
            ""Effect"": ""Allow"",
            ""Principal"": {
            ""Service"": [
                ""emr.aliyuncs.com"",
                ""ecs.aliyuncs.com""
            ]
            }
        }
        ],
        ""Version"": ""1""
    }
",
            Description = "this is a role test.",
            Force = true,
        });
        var defaultCluster = new AliCloud.Emr.Cluster("defaultCluster", new AliCloud.Emr.ClusterArgs
        {
            EmrVer = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.EmrVersion),
            ClusterType = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0]),
            HostGroups = 
            {
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "master_group",
                    HostGroupType = "MASTER",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "1",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "core_group",
                    HostGroupType = "CORE",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "4",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "task_group",
                    HostGroupType = "TASK",
                    NodeCount = "2",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "4",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
            },
            HighAvailabilityEnable = true,
            ZoneId = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId),
            SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
            IsOpenPublicIp = true,
            ChargeType = "PostPaid",
            VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
            UserDefinedEmrEcsRole = defaultRole.Name,
            SshEnable = true,
            MasterPwd = "ABCtest1234!",
        });
    }

}

Coming soon!

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

default_main_versions = alicloud.emr.get_main_versions()
default_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    support_local_storage=False,
    instance_charge_type="PostPaid",
    support_node_types=[
        "MASTER",
        "CORE",
        "TASK",
    ])
data_disk = alicloud.emr.get_disk_types(destination_resource="DataDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if var.vpc_id ==  else 0 == True)]:
    vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}", cidr_block=var["vpc_cidr"]))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if var.security_group_id ==  else 0 == True)]:
    default_security_group.append(alicloud.ecs.SecurityGroup(f"defaultSecurityGroup-{range['value']}", vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if var.vswitch_id ==  else 0 == True)]:
    vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
        availability_zone=default_instance_types.types[0].zone_id if var["availability_zone"] == "" else var["availability_zone"],
        vswitch_name=var["vswitch_name"],
        cidr_block=var["vswitch_cidr"],
        vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# Ram role Resource for Module
default_role = alicloud.ram.Role("defaultRole",
    document="""    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
""",
    description="this is a role test.",
    force=True)
default_cluster = alicloud.emr.Cluster("defaultCluster",
    emr_ver=default_main_versions.main_versions[0].emr_version,
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    host_groups=[
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="master_group",
            host_group_type="MASTER",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="1",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="core_group",
            host_group_type="CORE",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="4",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
        alicloud.emr.ClusterHostGroupArgs(
            host_group_name="task_group",
            host_group_type="TASK",
            node_count="2",
            instance_type=default_instance_types.types[0].id,
            disk_type=data_disk.types[0].value,
            disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
            disk_count="4",
            sys_disk_type=system_disk.types[0].value,
            sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
        ),
    ],
    high_availability_enable=True,
    zone_id=default_instance_types.types[0].zone_id,
    security_group_id=default_security_group.id if var["security_group_id"] == "" else var["security_group_id"],
    is_open_public_ip=True,
    charge_type="PostPaid",
    vswitch_id=vswitch.id if var["vswitch_id"] == "" else var["vswitch_id"],
    user_defined_emr_ecs_role=default_role.name,
    ssh_enable=True,
    master_pwd="ABCtest1234!")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultMainVersions = alicloud.emr.getMainVersions({});
const defaultInstanceTypes = defaultMainVersions.then(defaultMainVersions => alicloud.emr.getInstanceTypes({
    destinationResource: "InstanceType",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    supportLocalStorage: false,
    instanceChargeType: "PostPaid",
    supportNodeTypes: [
        "MASTER",
        "CORE",
        "TASK",
    ],
}));
const dataDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "DataDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const systemDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "SystemDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[];
for (const range = {value: 0}; range.value < (_var.vpc_id == "" ? 1 : 0 == true); range.value++) {
    vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {cidrBlock: _var.vpc_cidr}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[];
for (const range = {value: 0}; range.value < (_var.security_group_id == "" ? 1 : 0 == true); range.value++) {
    defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`defaultSecurityGroup-${range.value}`, {vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[];
for (const range = {value: 0}; range.value < (_var.vswitch_id == "" ? 1 : 0 == true); range.value++) {
    vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
        availabilityZone: _var.availability_zone == "" ? defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId) : _var.availability_zone,
        vswitchName: _var.vswitch_name,
        cidrBlock: _var.vswitch_cidr,
        vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id,
    }));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("defaultRole", {
    document: `    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
`,
    description: "this is a role test.",
    force: true,
});
const defaultCluster = new alicloud.emr.Cluster("defaultCluster", {
    emrVer: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.emrVersion),
    clusterType: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.clusterTypes?[0]),
    hostGroups: [
        {
            hostGroupName: "master_group",
            hostGroupType: "MASTER",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "1",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
        {
            hostGroupName: "core_group",
            hostGroupType: "CORE",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "4",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
        {
            hostGroupName: "task_group",
            hostGroupType: "TASK",
            nodeCount: "2",
            instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
            diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
            diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
            diskCount: "4",
            sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
            sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
        },
    ],
    highAvailabilityEnable: true,
    zoneId: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId),
    securityGroupId: _var.security_group_id == "" ? defaultSecurityGroup.id : _var.security_group_id,
    isOpenPublicIp: true,
    chargeType: "PostPaid",
    vswitchId: _var.vswitch_id == "" ? vswitch.id : _var.vswitch_id,
    userDefinedEmrEcsRole: defaultRole.name,
    sshEnable: true,
    masterPwd: "ABCtest1234!",
});

Coming soon!

4. Create a emr gateway cluster

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultMainVersions = Output.Create(AliCloud.Emr.GetMainVersions.InvokeAsync());
        var defaultInstanceTypes = defaultMainVersions.Apply(defaultMainVersions => Output.Create(AliCloud.Emr.GetInstanceTypes.InvokeAsync(new AliCloud.Emr.GetInstanceTypesArgs
        {
            DestinationResource = "InstanceType",
            ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
            SupportLocalStorage = false,
            InstanceChargeType = "PostPaid",
            SupportNodeTypes = 
            {
                "GATEWAY",
            },
        })));
        var dataDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "DataDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var systemDisk = Output.Tuple(defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes).Apply(values =>
        {
            var defaultMainVersions = values.Item1;
            var defaultInstanceTypes = values.Item2;
            var defaultInstanceTypes1 = values.Item3;
            return Output.Create(AliCloud.Emr.GetDiskTypes.InvokeAsync(new AliCloud.Emr.GetDiskTypesArgs
            {
                DestinationResource = "SystemDisk",
                ClusterType = defaultMainVersions.MainVersions?[0]?.ClusterTypes?[0],
                InstanceChargeType = "PostPaid",
                InstanceType = defaultInstanceTypes.Types?[0]?.Id,
                ZoneId = defaultInstanceTypes1.Types?[0]?.ZoneId,
            }));
        });
        var vpc = new List<AliCloud.Vpc.Network>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new AliCloud.Vpc.NetworkArgs
            {
                CidrBlock = @var.Vpc_cidr,
            }));
        }
        var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
        for (var rangeIndex = 0; rangeIndex < (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new AliCloud.Ecs.SecurityGroupArgs
            {
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // VSwitch Resource for Module
        var vswitch = new List<AliCloud.Vpc.Switch>();
        for (var rangeIndex = 0; rangeIndex < (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new AliCloud.Vpc.SwitchArgs
            {
                AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId) : @var.Availability_zone,
                VswitchName = @var.Vswitch_name,
                CidrBlock = @var.Vswitch_cidr,
                VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
            }));
        }
        // Ram role Resource for Module
        var defaultRole = new AliCloud.Ram.Role("defaultRole", new AliCloud.Ram.RoleArgs
        {
            Document = @"    {
        ""Statement"": [
        {
            ""Action"": ""sts:AssumeRole"",
            ""Effect"": ""Allow"",
            ""Principal"": {
            ""Service"": [
                ""emr.aliyuncs.com"",
                ""ecs.aliyuncs.com""
            ]
            }
        }
        ],
        ""Version"": ""1""
    }
",
            Description = "this is a role test.",
            Force = true,
        });
        var gateway = new AliCloud.Emr.Cluster("gateway", new AliCloud.Emr.ClusterArgs
        {
            EmrVer = defaultMainVersions.Apply(defaultMainVersions => defaultMainVersions.MainVersions?[0]?.EmrVersion),
            ClusterType = "GATEWAY",
            HostGroups = 
            {
                new AliCloud.Emr.Inputs.ClusterHostGroupArgs
                {
                    HostGroupName = "master_group",
                    HostGroupType = "GATEWAY",
                    NodeCount = "1",
                    InstanceType = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.Id),
                    DiskType = dataDisk.Apply(dataDisk => dataDisk.Types?[0]?.Value),
                    DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
                    {
                        var dataDisk = values.Item1;
                        var dataDisk1 = values.Item2;
                        return dataDisk.Types?[0]?.Min > 160 ? dataDisk1.Types?[0]?.Min : 160;
                    }),
                    DiskCount = "1",
                    SysDiskType = systemDisk.Apply(systemDisk => systemDisk.Types?[0]?.Value),
                    SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
                    {
                        var systemDisk = values.Item1;
                        var systemDisk1 = values.Item2;
                        return systemDisk.Types?[0]?.Min > 160 ? systemDisk1.Types?[0]?.Min : 160;
                    }),
                },
            },
            HighAvailabilityEnable = true,
            ZoneId = defaultInstanceTypes.Apply(defaultInstanceTypes => defaultInstanceTypes.Types?[0]?.ZoneId),
            SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
            IsOpenPublicIp = true,
            ChargeType = "PostPaid",
            VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
            UserDefinedEmrEcsRole = defaultRole.Name,
            SshEnable = true,
            MasterPwd = "ABCtest1234!",
            RelatedClusterId = related_cluster_id,
        });
    }

}

Coming soon!

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

default_main_versions = alicloud.emr.get_main_versions()
default_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    support_local_storage=False,
    instance_charge_type="PostPaid",
    support_node_types=["GATEWAY"])
data_disk = alicloud.emr.get_disk_types(destination_resource="DataDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
    cluster_type=default_main_versions.main_versions[0].cluster_types[0],
    instance_charge_type="PostPaid",
    instance_type=default_instance_types.types[0].id,
    zone_id=default_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if var.vpc_id ==  else 0 == True)]:
    vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}", cidr_block=var["vpc_cidr"]))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if var.security_group_id ==  else 0 == True)]:
    default_security_group.append(alicloud.ecs.SecurityGroup(f"defaultSecurityGroup-{range['value']}", vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if var.vswitch_id ==  else 0 == True)]:
    vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
        availability_zone=default_instance_types.types[0].zone_id if var["availability_zone"] == "" else var["availability_zone"],
        vswitch_name=var["vswitch_name"],
        cidr_block=var["vswitch_cidr"],
        vpc_id=vpc.id if var["vpc_id"] == "" else var["vpc_id"]))
# Ram role Resource for Module
default_role = alicloud.ram.Role("defaultRole",
    document="""    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
""",
    description="this is a role test.",
    force=True)
gateway = alicloud.emr.Cluster("gateway",
    emr_ver=default_main_versions.main_versions[0].emr_version,
    cluster_type="GATEWAY",
    host_groups=[alicloud.emr.ClusterHostGroupArgs(
        host_group_name="master_group",
        host_group_type="GATEWAY",
        node_count="1",
        instance_type=default_instance_types.types[0].id,
        disk_type=data_disk.types[0].value,
        disk_capacity=data_disk.types[0].min if data_disk.types[0].min > 160 else "160",
        disk_count="1",
        sys_disk_type=system_disk.types[0].value,
        sys_disk_capacity=system_disk.types[0].min if system_disk.types[0].min > 160 else "160",
    )],
    high_availability_enable=True,
    zone_id=default_instance_types.types[0].zone_id,
    security_group_id=default_security_group.id if var["security_group_id"] == "" else var["security_group_id"],
    is_open_public_ip=True,
    charge_type="PostPaid",
    vswitch_id=vswitch.id if var["vswitch_id"] == "" else var["vswitch_id"],
    user_defined_emr_ecs_role=default_role.name,
    ssh_enable=True,
    master_pwd="ABCtest1234!",
    related_cluster_id=related_cluster_id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultMainVersions = alicloud.emr.getMainVersions({});
const defaultInstanceTypes = defaultMainVersions.then(defaultMainVersions => alicloud.emr.getInstanceTypes({
    destinationResource: "InstanceType",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    supportLocalStorage: false,
    instanceChargeType: "PostPaid",
    supportNodeTypes: ["GATEWAY"],
}));
const dataDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "DataDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const systemDisk = Promise.all([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes]).then(([defaultMainVersions, defaultInstanceTypes, defaultInstanceTypes1]) => alicloud.emr.getDiskTypes({
    destinationResource: "SystemDisk",
    clusterType: defaultMainVersions.mainVersions?[0]?.clusterTypes?[0],
    instanceChargeType: "PostPaid",
    instanceType: defaultInstanceTypes.types?[0]?.id,
    zoneId: defaultInstanceTypes1.types?[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[];
for (const range = {value: 0}; range.value < (_var.vpc_id == "" ? 1 : 0 == true); range.value++) {
    vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {cidrBlock: _var.vpc_cidr}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[];
for (const range = {value: 0}; range.value < (_var.security_group_id == "" ? 1 : 0 == true); range.value++) {
    defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`defaultSecurityGroup-${range.value}`, {vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[];
for (const range = {value: 0}; range.value < (_var.vswitch_id == "" ? 1 : 0 == true); range.value++) {
    vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
        availabilityZone: _var.availability_zone == "" ? defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId) : _var.availability_zone,
        vswitchName: _var.vswitch_name,
        cidrBlock: _var.vswitch_cidr,
        vpcId: _var.vpc_id == "" ? vpc.id : _var.vpc_id,
    }));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("defaultRole", {
    document: `    {
        "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
            "Service": [
                "emr.aliyuncs.com",
                "ecs.aliyuncs.com"
            ]
            }
        }
        ],
        "Version": "1"
    }
`,
    description: "this is a role test.",
    force: true,
});
const gateway = new alicloud.emr.Cluster("gateway", {
    emrVer: defaultMainVersions.then(defaultMainVersions => defaultMainVersions.mainVersions?[0]?.emrVersion),
    clusterType: "GATEWAY",
    hostGroups: [{
        hostGroupName: "master_group",
        hostGroupType: "GATEWAY",
        nodeCount: "1",
        instanceType: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.id),
        diskType: dataDisk.then(dataDisk => dataDisk.types?[0]?.value),
        diskCapacity: Promise.all([dataDisk, dataDisk]).then(([dataDisk, dataDisk1]) => dataDisk.types?[0]?.min > 160 ? dataDisk1.types?[0]?.min : 160),
        diskCount: "1",
        sysDiskType: systemDisk.then(systemDisk => systemDisk.types?[0]?.value),
        sysDiskCapacity: Promise.all([systemDisk, systemDisk]).then(([systemDisk, systemDisk1]) => systemDisk.types?[0]?.min > 160 ? systemDisk1.types?[0]?.min : 160),
    }],
    highAvailabilityEnable: true,
    zoneId: defaultInstanceTypes.then(defaultInstanceTypes => defaultInstanceTypes.types?[0]?.zoneId),
    securityGroupId: _var.security_group_id == "" ? defaultSecurityGroup.id : _var.security_group_id,
    isOpenPublicIp: true,
    chargeType: "PostPaid",
    vswitchId: _var.vswitch_id == "" ? vswitch.id : _var.vswitch_id,
    userDefinedEmrEcsRole: defaultRole.name,
    sshEnable: true,
    masterPwd: "ABCtest1234!",
    relatedClusterId: related_cluster_id,
});

Coming soon!

Create a Cluster Resource

new Cluster(name: string, args: ClusterArgs, opts?: CustomResourceOptions);
@overload
def Cluster(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            bootstrap_actions: Optional[Sequence[ClusterBootstrapActionArgs]] = None,
            charge_type: Optional[str] = None,
            cluster_type: Optional[str] = None,
            deposit_type: Optional[str] = None,
            eas_enable: Optional[bool] = None,
            emr_ver: Optional[str] = None,
            high_availability_enable: Optional[bool] = None,
            host_groups: Optional[Sequence[ClusterHostGroupArgs]] = None,
            is_open_public_ip: Optional[bool] = None,
            key_pair_name: Optional[str] = None,
            master_pwd: Optional[str] = None,
            name: Optional[str] = None,
            option_software_lists: Optional[Sequence[str]] = None,
            period: Optional[int] = None,
            related_cluster_id: Optional[str] = None,
            security_group_id: Optional[str] = None,
            ssh_enable: Optional[bool] = None,
            tags: Optional[Mapping[str, Any]] = None,
            use_local_metadb: Optional[bool] = None,
            user_defined_emr_ecs_role: Optional[str] = None,
            vswitch_id: Optional[str] = None,
            zone_id: Optional[str] = None)
@overload
def Cluster(resource_name: str,
            args: ClusterArgs,
            opts: Optional[ResourceOptions] = None)
func NewCluster(ctx *Context, name string, args ClusterArgs, opts ...ResourceOption) (*Cluster, error)
public Cluster(string name, ClusterArgs args, CustomResourceOptions? opts = null)
public Cluster(String name, ClusterArgs args)
public Cluster(String name, ClusterArgs args, CustomResourceOptions options)
type: alicloud:emr:Cluster
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ClusterArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Cluster Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Cluster resource accepts the following input properties:

ClusterType string

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

EmrVer string

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

ZoneId string

Zone ID, e.g. cn-huhehaote-a

BootstrapActions List<Pulumi.AliCloud.Emr.Inputs.ClusterBootstrapActionArgs>
ChargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

DepositType string

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

EasEnable bool

High security cluster (true) or not. Default value is false.

HighAvailabilityEnable bool

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

HostGroups List<Pulumi.AliCloud.Emr.Inputs.ClusterHostGroupArgs>

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

IsOpenPublicIp bool
KeyPairName string

Ssh key pair.

MasterPwd string

Master ssh password.

Name string

bootstrap action name.

OptionSoftwareLists List<string>

Optional software list.

Period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

RelatedClusterId string

This specify the related cluster id, if this cluster is a Gateway.

SecurityGroupId string

Security Group ID for Cluster, you can also specify this key for each host group.

SshEnable bool

If this is set true, we can ssh into cluster. Default value is false.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

UseLocalMetadb bool

Use local metadb. Default is false.

UserDefinedEmrEcsRole string

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

VswitchId string

Global vswitch id, you can also specify it in host group.

ClusterType string

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

EmrVer string

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

ZoneId string

Zone ID, e.g. cn-huhehaote-a

BootstrapActions []ClusterBootstrapActionArgs
ChargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

DepositType string

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

EasEnable bool

High security cluster (true) or not. Default value is false.

HighAvailabilityEnable bool

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

HostGroups []ClusterHostGroupArgs

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

IsOpenPublicIp bool
KeyPairName string

Ssh key pair.

MasterPwd string

Master ssh password.

Name string

bootstrap action name.

OptionSoftwareLists []string

Optional software list.

Period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

RelatedClusterId string

This specify the related cluster id, if this cluster is a Gateway.

SecurityGroupId string

Security Group ID for Cluster, you can also specify this key for each host group.

SshEnable bool

If this is set true, we can ssh into cluster. Default value is false.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

UseLocalMetadb bool

Use local metadb. Default is false.

UserDefinedEmrEcsRole string

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

VswitchId string

Global vswitch id, you can also specify it in host group.

clusterType String

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

emrVer String

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

zoneId String

Zone ID, e.g. cn-huhehaote-a

bootstrapActions List<ClusterBootstrapActionArgs>
chargeType String

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

depositType String

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

easEnable Boolean

High security cluster (true) or not. Default value is false.

highAvailabilityEnable Boolean

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

hostGroups List<ClusterHostGroupArgs>

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

isOpenPublicIp Boolean
keyPairName String

Ssh key pair.

masterPwd String

Master ssh password.

name String

bootstrap action name.

optionSoftwareLists List<String>

Optional software list.

period Integer

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

relatedClusterId String

This specify the related cluster id, if this cluster is a Gateway.

securityGroupId String

Security Group ID for Cluster, you can also specify this key for each host group.

sshEnable Boolean

If this is set true, we can ssh into cluster. Default value is false.

tags Map<String,Object>

A mapping of tags to assign to the resource.

useLocalMetadb Boolean

Use local metadb. Default is false.

userDefinedEmrEcsRole String

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitchId String

Global vswitch id, you can also specify it in host group.

clusterType string

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

emrVer string

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

zoneId string

Zone ID, e.g. cn-huhehaote-a

bootstrapActions ClusterBootstrapActionArgs[]
chargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

depositType string

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

easEnable boolean

High security cluster (true) or not. Default value is false.

highAvailabilityEnable boolean

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

hostGroups ClusterHostGroupArgs[]

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

isOpenPublicIp boolean
keyPairName string

Ssh key pair.

masterPwd string

Master ssh password.

name string

bootstrap action name.

optionSoftwareLists string[]

Optional software list.

period number

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

relatedClusterId string

This specify the related cluster id, if this cluster is a Gateway.

securityGroupId string

Security Group ID for Cluster, you can also specify this key for each host group.

sshEnable boolean

If this is set true, we can ssh into cluster. Default value is false.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

useLocalMetadb boolean

Use local metadb. Default is false.

userDefinedEmrEcsRole string

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitchId string

Global vswitch id, you can also specify it in host group.

cluster_type str

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

emr_ver str

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

zone_id str

Zone ID, e.g. cn-huhehaote-a

bootstrap_actions Sequence[ClusterBootstrapActionArgs]
charge_type str

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

deposit_type str

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

eas_enable bool

High security cluster (true) or not. Default value is false.

high_availability_enable bool

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

host_groups Sequence[ClusterHostGroupArgs]

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

is_open_public_ip bool
key_pair_name str

Ssh key pair.

master_pwd str

Master ssh password.

name str

bootstrap action name.

option_software_lists Sequence[str]

Optional software list.

period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

related_cluster_id str

This specify the related cluster id, if this cluster is a Gateway.

security_group_id str

Security Group ID for Cluster, you can also specify this key for each host group.

ssh_enable bool

If this is set true, we can ssh into cluster. Default value is false.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

use_local_metadb bool

Use local metadb. Default is false.

user_defined_emr_ecs_role str

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitch_id str

Global vswitch id, you can also specify it in host group.

clusterType String

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

emrVer String

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

zoneId String

Zone ID, e.g. cn-huhehaote-a

bootstrapActions List<Property Map>
chargeType String

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

depositType String

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

easEnable Boolean

High security cluster (true) or not. Default value is false.

highAvailabilityEnable Boolean

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

hostGroups List<Property Map>

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

isOpenPublicIp Boolean
keyPairName String

Ssh key pair.

masterPwd String

Master ssh password.

name String

bootstrap action name.

optionSoftwareLists List<String>

Optional software list.

period Number

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

relatedClusterId String

This specify the related cluster id, if this cluster is a Gateway.

securityGroupId String

Security Group ID for Cluster, you can also specify this key for each host group.

sshEnable Boolean

If this is set true, we can ssh into cluster. Default value is false.

tags Map<Any>

A mapping of tags to assign to the resource.

useLocalMetadb Boolean

Use local metadb. Default is false.

userDefinedEmrEcsRole String

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitchId String

Global vswitch id, you can also specify it in host group.

Outputs

All input properties are implicitly available as output properties. Additionally, the Cluster resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing Cluster Resource

Get an existing Cluster resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ClusterState, opts?: CustomResourceOptions): Cluster
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bootstrap_actions: Optional[Sequence[ClusterBootstrapActionArgs]] = None,
        charge_type: Optional[str] = None,
        cluster_type: Optional[str] = None,
        deposit_type: Optional[str] = None,
        eas_enable: Optional[bool] = None,
        emr_ver: Optional[str] = None,
        high_availability_enable: Optional[bool] = None,
        host_groups: Optional[Sequence[ClusterHostGroupArgs]] = None,
        is_open_public_ip: Optional[bool] = None,
        key_pair_name: Optional[str] = None,
        master_pwd: Optional[str] = None,
        name: Optional[str] = None,
        option_software_lists: Optional[Sequence[str]] = None,
        period: Optional[int] = None,
        related_cluster_id: Optional[str] = None,
        security_group_id: Optional[str] = None,
        ssh_enable: Optional[bool] = None,
        tags: Optional[Mapping[str, Any]] = None,
        use_local_metadb: Optional[bool] = None,
        user_defined_emr_ecs_role: Optional[str] = None,
        vswitch_id: Optional[str] = None,
        zone_id: Optional[str] = None) -> Cluster
func GetCluster(ctx *Context, name string, id IDInput, state *ClusterState, opts ...ResourceOption) (*Cluster, error)
public static Cluster Get(string name, Input<string> id, ClusterState? state, CustomResourceOptions? opts = null)
public static Cluster get(String name, Output<String> id, ClusterState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
BootstrapActions List<Pulumi.AliCloud.Emr.Inputs.ClusterBootstrapActionArgs>
ChargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

ClusterType string

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

DepositType string

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

EasEnable bool

High security cluster (true) or not. Default value is false.

EmrVer string

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

HighAvailabilityEnable bool

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

HostGroups List<Pulumi.AliCloud.Emr.Inputs.ClusterHostGroupArgs>

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

IsOpenPublicIp bool
KeyPairName string

Ssh key pair.

MasterPwd string

Master ssh password.

Name string

bootstrap action name.

OptionSoftwareLists List<string>

Optional software list.

Period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

RelatedClusterId string

This specify the related cluster id, if this cluster is a Gateway.

SecurityGroupId string

Security Group ID for Cluster, you can also specify this key for each host group.

SshEnable bool

If this is set true, we can ssh into cluster. Default value is false.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

UseLocalMetadb bool

Use local metadb. Default is false.

UserDefinedEmrEcsRole string

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

VswitchId string

Global vswitch id, you can also specify it in host group.

ZoneId string

Zone ID, e.g. cn-huhehaote-a

BootstrapActions []ClusterBootstrapActionArgs
ChargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

ClusterType string

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

DepositType string

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

EasEnable bool

High security cluster (true) or not. Default value is false.

EmrVer string

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

HighAvailabilityEnable bool

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

HostGroups []ClusterHostGroupArgs

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

IsOpenPublicIp bool
KeyPairName string

Ssh key pair.

MasterPwd string

Master ssh password.

Name string

bootstrap action name.

OptionSoftwareLists []string

Optional software list.

Period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

RelatedClusterId string

This specify the related cluster id, if this cluster is a Gateway.

SecurityGroupId string

Security Group ID for Cluster, you can also specify this key for each host group.

SshEnable bool

If this is set true, we can ssh into cluster. Default value is false.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

UseLocalMetadb bool

Use local metadb. Default is false.

UserDefinedEmrEcsRole string

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

VswitchId string

Global vswitch id, you can also specify it in host group.

ZoneId string

Zone ID, e.g. cn-huhehaote-a

bootstrapActions List<ClusterBootstrapActionArgs>
chargeType String

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

clusterType String

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

depositType String

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

easEnable Boolean

High security cluster (true) or not. Default value is false.

emrVer String

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

highAvailabilityEnable Boolean

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

hostGroups List<ClusterHostGroupArgs>

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

isOpenPublicIp Boolean
keyPairName String

Ssh key pair.

masterPwd String

Master ssh password.

name String

bootstrap action name.

optionSoftwareLists List<String>

Optional software list.

period Integer

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

relatedClusterId String

This specify the related cluster id, if this cluster is a Gateway.

securityGroupId String

Security Group ID for Cluster, you can also specify this key for each host group.

sshEnable Boolean

If this is set true, we can ssh into cluster. Default value is false.

tags Map<String,Object>

A mapping of tags to assign to the resource.

useLocalMetadb Boolean

Use local metadb. Default is false.

userDefinedEmrEcsRole String

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitchId String

Global vswitch id, you can also specify it in host group.

zoneId String

Zone ID, e.g. cn-huhehaote-a

bootstrapActions ClusterBootstrapActionArgs[]
chargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

clusterType string

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

depositType string

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

easEnable boolean

High security cluster (true) or not. Default value is false.

emrVer string

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

highAvailabilityEnable boolean

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

hostGroups ClusterHostGroupArgs[]

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

isOpenPublicIp boolean
keyPairName string

Ssh key pair.

masterPwd string

Master ssh password.

name string

bootstrap action name.

optionSoftwareLists string[]

Optional software list.

period number

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

relatedClusterId string

This specify the related cluster id, if this cluster is a Gateway.

securityGroupId string

Security Group ID for Cluster, you can also specify this key for each host group.

sshEnable boolean

If this is set true, we can ssh into cluster. Default value is false.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

useLocalMetadb boolean

Use local metadb. Default is false.

userDefinedEmrEcsRole string

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitchId string

Global vswitch id, you can also specify it in host group.

zoneId string

Zone ID, e.g. cn-huhehaote-a

bootstrap_actions Sequence[ClusterBootstrapActionArgs]
charge_type str

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

cluster_type str

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

deposit_type str

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

eas_enable bool

High security cluster (true) or not. Default value is false.

emr_ver str

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

high_availability_enable bool

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

host_groups Sequence[ClusterHostGroupArgs]

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

is_open_public_ip bool
key_pair_name str

Ssh key pair.

master_pwd str

Master ssh password.

name str

bootstrap action name.

option_software_lists Sequence[str]

Optional software list.

period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

related_cluster_id str

This specify the related cluster id, if this cluster is a Gateway.

security_group_id str

Security Group ID for Cluster, you can also specify this key for each host group.

ssh_enable bool

If this is set true, we can ssh into cluster. Default value is false.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

use_local_metadb bool

Use local metadb. Default is false.

user_defined_emr_ecs_role str

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitch_id str

Global vswitch id, you can also specify it in host group.

zone_id str

Zone ID, e.g. cn-huhehaote-a

bootstrapActions List<Property Map>
chargeType String

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

clusterType String

EMR Cluster Type, e.g. HADOOP, KAFKA, DRUID, GATEWAY etc. You can find all valid EMR cluster type in emr web console. Supported 'GATEWAY' available in 1.61.0+.

depositType String

Cluster deposit type, HALF_MANAGED or FULL_MANAGED.

easEnable Boolean

High security cluster (true) or not. Default value is false.

emrVer String

EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.

highAvailabilityEnable Boolean

High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.

hostGroups List<Property Map>

Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).

isOpenPublicIp Boolean
keyPairName String

Ssh key pair.

masterPwd String

Master ssh password.

name String

bootstrap action name.

optionSoftwareLists List<String>

Optional software list.

period Number

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

relatedClusterId String

This specify the related cluster id, if this cluster is a Gateway.

securityGroupId String

Security Group ID for Cluster, you can also specify this key for each host group.

sshEnable Boolean

If this is set true, we can ssh into cluster. Default value is false.

tags Map<Any>

A mapping of tags to assign to the resource.

useLocalMetadb Boolean

Use local metadb. Default is false.

userDefinedEmrEcsRole String

Alicloud EMR uses roles to perform actions on your behalf when provisioning cluster resources, running applications, dynamically scaling resources. EMR uses the following roles when interacting with other Alicloud services. Default value is AliyunEmrEcsDefaultRole.

vswitchId String

Global vswitch id, you can also specify it in host group.

zoneId String

Zone ID, e.g. cn-huhehaote-a

Supporting Types

ClusterBootstrapAction

Arg string

bootstrap action args, e.g. "--a=b".

Name string

bootstrap action name.

Path string

bootstrap action path, e.g. "oss://bucket/path".

Arg string

bootstrap action args, e.g. "--a=b".

Name string

bootstrap action name.

Path string

bootstrap action path, e.g. "oss://bucket/path".

arg String

bootstrap action args, e.g. "--a=b".

name String

bootstrap action name.

path String

bootstrap action path, e.g. "oss://bucket/path".

arg string

bootstrap action args, e.g. "--a=b".

name string

bootstrap action name.

path string

bootstrap action path, e.g. "oss://bucket/path".

arg str

bootstrap action args, e.g. "--a=b".

name str

bootstrap action name.

path str

bootstrap action path, e.g. "oss://bucket/path".

arg String

bootstrap action args, e.g. "--a=b".

name String

bootstrap action name.

path String

bootstrap action path, e.g. "oss://bucket/path".

ClusterHostGroup

AutoRenew bool

Auto renew for prepaid, true of false. Default is false.

ChargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

DiskCapacity string

Data disk capacity.

DiskCount string

Data disk count.

DiskType string

Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.

GpuDriver string
HostGroupName string

host group name.

HostGroupType string

host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.

InstanceList string

Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".

InstanceType string

Host Ecs instance type.

NodeCount string

Host number in this group.

Period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

SysDiskCapacity string

System disk capacity.

SysDiskType string

System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.

AutoRenew bool

Auto renew for prepaid, true of false. Default is false.

ChargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

DiskCapacity string

Data disk capacity.

DiskCount string

Data disk count.

DiskType string

Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.

GpuDriver string
HostGroupName string

host group name.

HostGroupType string

host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.

InstanceList string

Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".

InstanceType string

Host Ecs instance type.

NodeCount string

Host number in this group.

Period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

SysDiskCapacity string

System disk capacity.

SysDiskType string

System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.

autoRenew Boolean

Auto renew for prepaid, true of false. Default is false.

chargeType String

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

diskCapacity String

Data disk capacity.

diskCount String

Data disk count.

diskType String

Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.

gpuDriver String
hostGroupName String

host group name.

hostGroupType String

host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.

instanceList String

Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".

instanceType String

Host Ecs instance type.

nodeCount String

Host number in this group.

period Integer

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

sysDiskCapacity String

System disk capacity.

sysDiskType String

System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.

autoRenew boolean

Auto renew for prepaid, true of false. Default is false.

chargeType string

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

diskCapacity string

Data disk capacity.

diskCount string

Data disk count.

diskType string

Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.

gpuDriver string
hostGroupName string

host group name.

hostGroupType string

host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.

instanceList string

Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".

instanceType string

Host Ecs instance type.

nodeCount string

Host number in this group.

period number

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

sysDiskCapacity string

System disk capacity.

sysDiskType string

System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.

auto_renew bool

Auto renew for prepaid, true of false. Default is false.

charge_type str

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

disk_capacity str

Data disk capacity.

disk_count str

Data disk count.

disk_type str

Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.

gpu_driver str
host_group_name str

host group name.

host_group_type str

host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.

instance_list str

Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".

instance_type str

Host Ecs instance type.

node_count str

Host number in this group.

period int

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

sys_disk_capacity str

System disk capacity.

sys_disk_type str

System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.

autoRenew Boolean

Auto renew for prepaid, true of false. Default is false.

chargeType String

Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.

diskCapacity String

Data disk capacity.

diskCount String

Data disk count.

diskType String

Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.

gpuDriver String
hostGroupName String

host group name.

hostGroupType String

host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.

instanceList String

Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".

instanceType String

Host Ecs instance type.

nodeCount String

Host number in this group.

period Number

If charge type is PrePaid, this should be specified, unit is month. Supported value: 1、2、3、4、5、6、7、8、9、12、24、36.

sysDiskCapacity String

System disk capacity.

sysDiskType String

System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.

Import

Aliclioud E-MapReduce cluster can be imported using the id e.g.

 $ pulumi import alicloud:emr/cluster:Cluster default C-B47FB8FE96C67XXXX

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.