alicloud.emr.Cluster
Explore with Pulumi AI
Provides a EMR Cluster resource. With this you can create, read, and release EMR Cluster.
DEPRECATED: This resource has been deprecated from version
1.204.0
. Please use new resource emrv2_cluster.
NOTE: Available in 1.57.0+.
Example Usage
1. Create A Cluster
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const default = alicloud.emr.getMainVersions({});
const defaultGetInstanceTypes = _default.then(_default => alicloud.emr.getInstanceTypes({
destinationResource: "InstanceType",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
supportLocalStorage: false,
instanceChargeType: "PostPaid",
supportNodeTypes: [
"MASTER",
"CORE",
"TASK",
],
}));
const dataDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "DataDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const systemDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "SystemDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[] = [];
for (const range = {value: 0}; range.value < (vpcId == "" ? 1 : 0); range.value++) {
vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {
name: vpcName,
cidrBlock: vpcCidr,
}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[] = [];
for (const range = {value: 0}; range.value < (securityGroupId == "" ? 1 : 0); range.value++) {
defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`default-${range.value}`, {
name: securityGroupName,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[] = [];
for (const range = {value: 0}; range.value < (vswitchId == "" ? 1 : 0); range.value++) {
vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
availabilityZone: availabilityZone == "" ? defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId) : availabilityZone,
vswitchName: vswitchName,
cidrBlock: vswitchCidr,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("default", {
name: ramName,
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("default", {
name: "terraform-create-cluster-test",
emrVer: _default.then(_default => _default.mainVersions?.[0]?.emrVersion),
clusterType: _default.then(_default => _default.mainVersions?.[0]?.clusterTypes?.[0]),
hostGroups: [
{
hostGroupName: "master_group",
hostGroupType: "MASTER",
nodeCount: "2",
instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId),
securityGroupId: securityGroupId == "" ? defaultSecurityGroup[0].id : securityGroupId,
isOpenPublicIp: true,
chargeType: "PostPaid",
vswitchId: vswitchId == "" ? vswitch[0].id : vswitchId,
userDefinedEmrEcsRole: defaultRole.name,
sshEnable: true,
masterPwd: "ABCtest1234!",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.emr.get_main_versions()
default_get_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
cluster_type=default.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[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
cluster_type=default.main_versions[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if vpc_id == else 0)]:
vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}",
name=vpc_name,
cidr_block=vpc_cidr))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if security_group_id == else 0)]:
default_security_group.append(alicloud.ecs.SecurityGroup(f"default-{range['value']}",
name=security_group_name,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if vswitch_id == else 0)]:
vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
availability_zone=default_get_instance_types.types[0].zone_id if availability_zone == "" else availability_zone,
vswitch_name=vswitch_name,
cidr_block=vswitch_cidr,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# Ram role Resource for Module
default_role = alicloud.ram.Role("default",
name=ram_name,
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("default",
name="terraform-create-cluster-test",
emr_ver=default.main_versions[0].emr_version,
cluster_type=default.main_versions[0].cluster_types[0],
host_groups=[
{
"host_group_name": "master_group",
"host_group_type": "MASTER",
"node_count": "2",
"instance_type": default_get_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",
},
{
"host_group_name": "core_group",
"host_group_type": "CORE",
"node_count": "3",
"instance_type": default_get_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",
},
{
"host_group_name": "task_group",
"host_group_type": "TASK",
"node_count": "2",
"instance_type": default_get_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_get_instance_types.types[0].zone_id,
security_group_id=default_security_group[0].id if security_group_id == "" else security_group_id,
is_open_public_ip=True,
charge_type="PostPaid",
vswitch_id=vswitch[0].id if vswitch_id == "" else vswitch_id,
user_defined_emr_ecs_role=default_role.name,
ssh_enable=True,
master_pwd="ABCtest1234!")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/emr"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := emr.GetMainVersions(ctx, nil, nil)
if err != nil {
return err
}
defaultGetInstanceTypes, err := emr.GetInstanceTypes(ctx, &emr.GetInstanceTypesArgs{
DestinationResource: "InstanceType",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
SupportLocalStorage: pulumi.BoolRef(false),
InstanceChargeType: "PostPaid",
SupportNodeTypes: []string{
"MASTER",
"CORE",
"TASK",
},
}, nil)
if err != nil {
return err
}
dataDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "DataDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
systemDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "SystemDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
var tmp0 float64
if vpcId == "" {
tmp0 = 1
} else {
tmp0 = 0
}
var vpc []*vpc.Network
for index := 0; index < tmp0; index++ {
key0 := index
_ := index
__res, err := vpc.NewNetwork(ctx, fmt.Sprintf("vpc-%v", key0), &vpc.NetworkArgs{
Name: pulumi.Any(vpcName),
CidrBlock: pulumi.Any(vpcCidr),
})
if err != nil {
return err
}
vpc = append(vpc, __res)
}
var tmp1 pulumi.String
if vpcId == "" {
tmp1 = vpc[0].ID()
} else {
tmp1 = pulumi.Any(vpcId)
}
var tmp2 float64
if securityGroupId == "" {
tmp2 = 1
} else {
tmp2 = 0
}
var defaultSecurityGroup []*ecs.SecurityGroup
for index := 0; index < tmp2; index++ {
key0 := index
_ := index
__res, err := ecs.NewSecurityGroup(ctx, fmt.Sprintf("default-%v", key0), &ecs.SecurityGroupArgs{
Name: pulumi.Any(securityGroupName),
VpcId: pulumi.String(tmp1),
})
if err != nil {
return err
}
defaultSecurityGroup = append(defaultSecurityGroup, __res)
}
var tmp3 pulumi.String
if availabilityZone == "" {
tmp3 = pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId)
} else {
tmp3 = pulumi.Any(availabilityZone)
}
var tmp4 pulumi.String
if vpcId == "" {
tmp4 = vpc[0].ID()
} else {
tmp4 = pulumi.Any(vpcId)
}
// VSwitch Resource for Module
var tmp5 float64
if vswitchId == "" {
tmp5 = 1
} else {
tmp5 = 0
}
var vswitch []*vpc.Switch
for index := 0; index < tmp5; index++ {
key0 := index
_ := index
__res, err := vpc.NewSwitch(ctx, fmt.Sprintf("vswitch-%v", key0), &vpc.SwitchArgs{
AvailabilityZone: pulumi.String(tmp3),
VswitchName: pulumi.Any(vswitchName),
CidrBlock: pulumi.Any(vswitchCidr),
VpcId: pulumi.String(tmp4),
})
if err != nil {
return err
}
vswitch = append(vswitch, __res)
}
// Ram role Resource for Module
defaultRole, err := ram.NewRole(ctx, "default", &ram.RoleArgs{
Name: pulumi.Any(ramName),
Document: pulumi.String(` {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"emr.aliyuncs.com",
"ecs.aliyuncs.com"
]
}
}
],
"Version": "1"
}
`),
Description: pulumi.String("this is a role test."),
Force: pulumi.Bool(true),
})
if err != nil {
return err
}
var tmp6 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp6 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp6 = pulumi.String("160")
}
var tmp7 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp7 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp7 = pulumi.String("160")
}
var tmp8 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp8 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp8 = pulumi.String("160")
}
var tmp9 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp9 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp9 = pulumi.String("160")
}
var tmp10 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp10 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp10 = pulumi.String("160")
}
var tmp11 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp11 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp11 = pulumi.String("160")
}
var tmp12 pulumi.String
if securityGroupId == "" {
tmp12 = defaultSecurityGroup[0].ID()
} else {
tmp12 = pulumi.Any(securityGroupId)
}
var tmp13 pulumi.String
if vswitchId == "" {
tmp13 = vswitch[0].ID()
} else {
tmp13 = pulumi.Any(vswitchId)
}
_, err = emr.NewCluster(ctx, "default", &emr.ClusterArgs{
Name: pulumi.String("terraform-create-cluster-test"),
EmrVer: pulumi.String(_default.MainVersions[0].EmrVersion),
ClusterType: pulumi.String(_default.MainVersions[0].ClusterTypes[0]),
HostGroups: emr.ClusterHostGroupArray{
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("master_group"),
HostGroupType: pulumi.String("MASTER"),
NodeCount: pulumi.String("2"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp6),
DiskCount: pulumi.String("1"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp7),
},
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("core_group"),
HostGroupType: pulumi.String("CORE"),
NodeCount: pulumi.String("3"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp8),
DiskCount: pulumi.String("4"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp9),
},
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("task_group"),
HostGroupType: pulumi.String("TASK"),
NodeCount: pulumi.String("2"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp10),
DiskCount: pulumi.String("4"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp11),
},
},
HighAvailabilityEnable: pulumi.Bool(true),
ZoneId: pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId),
SecurityGroupId: pulumi.String(tmp12),
IsOpenPublicIp: pulumi.Bool(true),
ChargeType: pulumi.String("PostPaid"),
VswitchId: pulumi.String(tmp13),
UserDefinedEmrEcsRole: defaultRole.Name,
SshEnable: pulumi.Bool(true),
MasterPwd: pulumi.String("ABCtest1234!"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Emr.GetMainVersions.Invoke();
var defaultGetInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
{
DestinationResource = "InstanceType",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
SupportLocalStorage = false,
InstanceChargeType = "PostPaid",
SupportNodeTypes = new[]
{
"MASTER",
"CORE",
"TASK",
},
});
var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "DataDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "SystemDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var vpc = new List<AliCloud.Vpc.Network>();
for (var rangeIndex = 0; rangeIndex < (vpcId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
{
Name = vpcName,
CidrBlock = vpcCidr,
}));
}
var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
for (var rangeIndex = 0; rangeIndex < (securityGroupId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"default-{range.Value}", new()
{
Name = securityGroupName,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// VSwitch Resource for Module
var vswitch = new List<AliCloud.Vpc.Switch>();
for (var rangeIndex = 0; rangeIndex < (vswitchId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
{
AvailabilityZone = availabilityZone == "" ? defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId) : availabilityZone,
VswitchName = vswitchName,
CidrBlock = vswitchCidr,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// Ram role Resource for Module
var defaultRole = new AliCloud.Ram.Role("default", new()
{
Name = ramName,
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("default", new()
{
Name = "terraform-create-cluster-test",
EmrVer = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.EmrVersion)),
ClusterType = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0])),
HostGroups = new[]
{
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "master_group",
HostGroupType = "MASTER",
NodeCount = "2",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "1",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "core_group",
HostGroupType = "CORE",
NodeCount = "3",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "4",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "task_group",
HostGroupType = "TASK",
NodeCount = "2",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "4",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
},
HighAvailabilityEnable = true,
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
SecurityGroupId = securityGroupId == "" ? defaultSecurityGroup[0].Id : securityGroupId,
IsOpenPublicIp = true,
ChargeType = "PostPaid",
VswitchId = vswitchId == "" ? vswitch[0].Id : vswitchId,
UserDefinedEmrEcsRole = defaultRole.Name,
SshEnable = true,
MasterPwd = "ABCtest1234!",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.emr.EmrFunctions;
import com.pulumi.alicloud.emr.inputs.GetMainVersionsArgs;
import com.pulumi.alicloud.emr.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.emr.inputs.GetDiskTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ram.Role;
import com.pulumi.alicloud.ram.RoleArgs;
import com.pulumi.alicloud.emr.Cluster;
import com.pulumi.alicloud.emr.ClusterArgs;
import com.pulumi.alicloud.emr.inputs.ClusterHostGroupArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = EmrFunctions.getMainVersions();
final var defaultGetInstanceTypes = EmrFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.destinationResource("InstanceType")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.supportLocalStorage(false)
.instanceChargeType("PostPaid")
.supportNodeTypes(
"MASTER",
"CORE",
"TASK")
.build());
final var dataDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("DataDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
final var systemDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("SystemDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
for (var i = 0; i < (vpcId == "" ? 1 : 0); i++) {
new Network("vpc-" + i, NetworkArgs.builder()
.name(vpcName)
.cidrBlock(vpcCidr)
.build());
}
for (var i = 0; i < (securityGroupId == "" ? 1 : 0); i++) {
new SecurityGroup("defaultSecurityGroup-" + i, SecurityGroupArgs.builder()
.name(securityGroupName)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// VSwitch Resource for Module
for (var i = 0; i < (vswitchId == "" ? 1 : 0); i++) {
new Switch("vswitch-" + i, SwitchArgs.builder()
.availabilityZone(availabilityZone == "" ? defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()) : availabilityZone)
.vswitchName(vswitchName)
.cidrBlock(vswitchCidr)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// Ram role Resource for Module
var defaultRole = new Role("defaultRole", RoleArgs.builder()
.name(ramName)
.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)
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.name("terraform-create-cluster-test")
.emrVer(default_.mainVersions()[0].emrVersion())
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.hostGroups(
ClusterHostGroupArgs.builder()
.hostGroupName("master_group")
.hostGroupType("MASTER")
.nodeCount("2")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("1")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build(),
ClusterHostGroupArgs.builder()
.hostGroupName("core_group")
.hostGroupType("CORE")
.nodeCount("3")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("4")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build(),
ClusterHostGroupArgs.builder()
.hostGroupName("task_group")
.hostGroupType("TASK")
.nodeCount("2")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("4")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build())
.highAvailabilityEnable(true)
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.securityGroupId(securityGroupId == "" ? defaultSecurityGroup[0].id() : securityGroupId)
.isOpenPublicIp(true)
.chargeType("PostPaid")
.vswitchId(vswitchId == "" ? vswitch[0].id() : vswitchId)
.userDefinedEmrEcsRole(defaultRole.name())
.sshEnable(true)
.masterPwd("ABCtest1234!")
.build());
}
}
Coming soon!
2. Scale Up
The hosts of EMR Cluster are orginized as host group. Scaling up/down is operating host group.
In the case of scaling up cluster, we should add the node_count of some host group.
NOTE: Scaling up is only applicable to CORE and TASK group. Cost time of scaling up will vary with the number of scaling-up nodes. Scaling down is only applicable to TASK group. If you want to scale down CORE group, please submit tickets or contact EMR support team.
As the following case, we scale up the TASK group 2 nodes by increasing host_group.node_count by 2.
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const default = alicloud.emr.getMainVersions({});
const defaultGetInstanceTypes = _default.then(_default => alicloud.emr.getInstanceTypes({
destinationResource: "InstanceType",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
supportLocalStorage: false,
instanceChargeType: "PostPaid",
supportNodeTypes: [
"MASTER",
"CORE",
"TASK",
],
}));
const dataDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "DataDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const systemDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "SystemDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[] = [];
for (const range = {value: 0}; range.value < (vpcId == "" ? 1 : 0); range.value++) {
vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {
name: vpcName,
cidrBlock: vpcCidr,
}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[] = [];
for (const range = {value: 0}; range.value < (securityGroupId == "" ? 1 : 0); range.value++) {
defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`default-${range.value}`, {
name: securityGroupName,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[] = [];
for (const range = {value: 0}; range.value < (vswitchId == "" ? 1 : 0); range.value++) {
vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
availabilityZone: availabilityZone == "" ? defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId) : availabilityZone,
vswitchName: vswitchName,
cidrBlock: vswitchCidr,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("default", {
name: ramName,
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("default", {
name: "terraform-resize-cluster-test",
emrVer: _default.then(_default => _default.mainVersions?.[0]?.emrVersion),
clusterType: _default.then(_default => _default.mainVersions?.[0]?.clusterTypes?.[0]),
hostGroups: [
{
hostGroupName: "master_group",
hostGroupType: "MASTER",
nodeCount: "2",
instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId),
securityGroupId: securityGroupId == "" ? defaultSecurityGroup[0].id : securityGroupId,
isOpenPublicIp: true,
chargeType: "PostPaid",
vswitchId: vswitchId == "" ? vswitch[0].id : vswitchId,
userDefinedEmrEcsRole: defaultRole.name,
sshEnable: true,
masterPwd: "ABCtest1234!",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.emr.get_main_versions()
default_get_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
cluster_type=default.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[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
cluster_type=default.main_versions[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if vpc_id == else 0)]:
vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}",
name=vpc_name,
cidr_block=vpc_cidr))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if security_group_id == else 0)]:
default_security_group.append(alicloud.ecs.SecurityGroup(f"default-{range['value']}",
name=security_group_name,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if vswitch_id == else 0)]:
vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
availability_zone=default_get_instance_types.types[0].zone_id if availability_zone == "" else availability_zone,
vswitch_name=vswitch_name,
cidr_block=vswitch_cidr,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# Ram role Resource for Module
default_role = alicloud.ram.Role("default",
name=ram_name,
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("default",
name="terraform-resize-cluster-test",
emr_ver=default.main_versions[0].emr_version,
cluster_type=default.main_versions[0].cluster_types[0],
host_groups=[
{
"host_group_name": "master_group",
"host_group_type": "MASTER",
"node_count": "2",
"instance_type": default_get_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",
},
{
"host_group_name": "core_group",
"host_group_type": "CORE",
"node_count": "3",
"instance_type": default_get_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",
},
{
"host_group_name": "task_group",
"host_group_type": "TASK",
"node_count": "4",
"instance_type": default_get_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_get_instance_types.types[0].zone_id,
security_group_id=default_security_group[0].id if security_group_id == "" else security_group_id,
is_open_public_ip=True,
charge_type="PostPaid",
vswitch_id=vswitch[0].id if vswitch_id == "" else vswitch_id,
user_defined_emr_ecs_role=default_role.name,
ssh_enable=True,
master_pwd="ABCtest1234!")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/emr"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := emr.GetMainVersions(ctx, nil, nil)
if err != nil {
return err
}
defaultGetInstanceTypes, err := emr.GetInstanceTypes(ctx, &emr.GetInstanceTypesArgs{
DestinationResource: "InstanceType",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
SupportLocalStorage: pulumi.BoolRef(false),
InstanceChargeType: "PostPaid",
SupportNodeTypes: []string{
"MASTER",
"CORE",
"TASK",
},
}, nil)
if err != nil {
return err
}
dataDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "DataDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
systemDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "SystemDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
var tmp0 float64
if vpcId == "" {
tmp0 = 1
} else {
tmp0 = 0
}
var vpc []*vpc.Network
for index := 0; index < tmp0; index++ {
key0 := index
_ := index
__res, err := vpc.NewNetwork(ctx, fmt.Sprintf("vpc-%v", key0), &vpc.NetworkArgs{
Name: pulumi.Any(vpcName),
CidrBlock: pulumi.Any(vpcCidr),
})
if err != nil {
return err
}
vpc = append(vpc, __res)
}
var tmp1 pulumi.String
if vpcId == "" {
tmp1 = vpc[0].ID()
} else {
tmp1 = pulumi.Any(vpcId)
}
var tmp2 float64
if securityGroupId == "" {
tmp2 = 1
} else {
tmp2 = 0
}
var defaultSecurityGroup []*ecs.SecurityGroup
for index := 0; index < tmp2; index++ {
key0 := index
_ := index
__res, err := ecs.NewSecurityGroup(ctx, fmt.Sprintf("default-%v", key0), &ecs.SecurityGroupArgs{
Name: pulumi.Any(securityGroupName),
VpcId: pulumi.String(tmp1),
})
if err != nil {
return err
}
defaultSecurityGroup = append(defaultSecurityGroup, __res)
}
var tmp3 pulumi.String
if availabilityZone == "" {
tmp3 = pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId)
} else {
tmp3 = pulumi.Any(availabilityZone)
}
var tmp4 pulumi.String
if vpcId == "" {
tmp4 = vpc[0].ID()
} else {
tmp4 = pulumi.Any(vpcId)
}
// VSwitch Resource for Module
var tmp5 float64
if vswitchId == "" {
tmp5 = 1
} else {
tmp5 = 0
}
var vswitch []*vpc.Switch
for index := 0; index < tmp5; index++ {
key0 := index
_ := index
__res, err := vpc.NewSwitch(ctx, fmt.Sprintf("vswitch-%v", key0), &vpc.SwitchArgs{
AvailabilityZone: pulumi.String(tmp3),
VswitchName: pulumi.Any(vswitchName),
CidrBlock: pulumi.Any(vswitchCidr),
VpcId: pulumi.String(tmp4),
})
if err != nil {
return err
}
vswitch = append(vswitch, __res)
}
// Ram role Resource for Module
defaultRole, err := ram.NewRole(ctx, "default", &ram.RoleArgs{
Name: pulumi.Any(ramName),
Document: pulumi.String(` {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"emr.aliyuncs.com",
"ecs.aliyuncs.com"
]
}
}
],
"Version": "1"
}
`),
Description: pulumi.String("this is a role test."),
Force: pulumi.Bool(true),
})
if err != nil {
return err
}
var tmp6 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp6 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp6 = pulumi.String("160")
}
var tmp7 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp7 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp7 = pulumi.String("160")
}
var tmp8 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp8 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp8 = pulumi.String("160")
}
var tmp9 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp9 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp9 = pulumi.String("160")
}
var tmp10 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp10 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp10 = pulumi.String("160")
}
var tmp11 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp11 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp11 = pulumi.String("160")
}
var tmp12 pulumi.String
if securityGroupId == "" {
tmp12 = defaultSecurityGroup[0].ID()
} else {
tmp12 = pulumi.Any(securityGroupId)
}
var tmp13 pulumi.String
if vswitchId == "" {
tmp13 = vswitch[0].ID()
} else {
tmp13 = pulumi.Any(vswitchId)
}
_, err = emr.NewCluster(ctx, "default", &emr.ClusterArgs{
Name: pulumi.String("terraform-resize-cluster-test"),
EmrVer: pulumi.String(_default.MainVersions[0].EmrVersion),
ClusterType: pulumi.String(_default.MainVersions[0].ClusterTypes[0]),
HostGroups: emr.ClusterHostGroupArray{
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("master_group"),
HostGroupType: pulumi.String("MASTER"),
NodeCount: pulumi.String("2"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp6),
DiskCount: pulumi.String("1"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp7),
},
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("core_group"),
HostGroupType: pulumi.String("CORE"),
NodeCount: pulumi.String("3"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp8),
DiskCount: pulumi.String("4"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp9),
},
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("task_group"),
HostGroupType: pulumi.String("TASK"),
NodeCount: pulumi.String("4"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp10),
DiskCount: pulumi.String("4"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp11),
},
},
HighAvailabilityEnable: pulumi.Bool(true),
ZoneId: pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId),
SecurityGroupId: pulumi.String(tmp12),
IsOpenPublicIp: pulumi.Bool(true),
ChargeType: pulumi.String("PostPaid"),
VswitchId: pulumi.String(tmp13),
UserDefinedEmrEcsRole: defaultRole.Name,
SshEnable: pulumi.Bool(true),
MasterPwd: pulumi.String("ABCtest1234!"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Emr.GetMainVersions.Invoke();
var defaultGetInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
{
DestinationResource = "InstanceType",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
SupportLocalStorage = false,
InstanceChargeType = "PostPaid",
SupportNodeTypes = new[]
{
"MASTER",
"CORE",
"TASK",
},
});
var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "DataDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "SystemDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var vpc = new List<AliCloud.Vpc.Network>();
for (var rangeIndex = 0; rangeIndex < (vpcId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
{
Name = vpcName,
CidrBlock = vpcCidr,
}));
}
var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
for (var rangeIndex = 0; rangeIndex < (securityGroupId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"default-{range.Value}", new()
{
Name = securityGroupName,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// VSwitch Resource for Module
var vswitch = new List<AliCloud.Vpc.Switch>();
for (var rangeIndex = 0; rangeIndex < (vswitchId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
{
AvailabilityZone = availabilityZone == "" ? defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId) : availabilityZone,
VswitchName = vswitchName,
CidrBlock = vswitchCidr,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// Ram role Resource for Module
var defaultRole = new AliCloud.Ram.Role("default", new()
{
Name = ramName,
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("default", new()
{
Name = "terraform-resize-cluster-test",
EmrVer = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.EmrVersion)),
ClusterType = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0])),
HostGroups = new[]
{
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "master_group",
HostGroupType = "MASTER",
NodeCount = "2",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "1",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "core_group",
HostGroupType = "CORE",
NodeCount = "3",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "4",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "task_group",
HostGroupType = "TASK",
NodeCount = "4",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "4",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
},
HighAvailabilityEnable = true,
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
SecurityGroupId = securityGroupId == "" ? defaultSecurityGroup[0].Id : securityGroupId,
IsOpenPublicIp = true,
ChargeType = "PostPaid",
VswitchId = vswitchId == "" ? vswitch[0].Id : vswitchId,
UserDefinedEmrEcsRole = defaultRole.Name,
SshEnable = true,
MasterPwd = "ABCtest1234!",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.emr.EmrFunctions;
import com.pulumi.alicloud.emr.inputs.GetMainVersionsArgs;
import com.pulumi.alicloud.emr.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.emr.inputs.GetDiskTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ram.Role;
import com.pulumi.alicloud.ram.RoleArgs;
import com.pulumi.alicloud.emr.Cluster;
import com.pulumi.alicloud.emr.ClusterArgs;
import com.pulumi.alicloud.emr.inputs.ClusterHostGroupArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = EmrFunctions.getMainVersions();
final var defaultGetInstanceTypes = EmrFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.destinationResource("InstanceType")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.supportLocalStorage(false)
.instanceChargeType("PostPaid")
.supportNodeTypes(
"MASTER",
"CORE",
"TASK")
.build());
final var dataDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("DataDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
final var systemDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("SystemDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
for (var i = 0; i < (vpcId == "" ? 1 : 0); i++) {
new Network("vpc-" + i, NetworkArgs.builder()
.name(vpcName)
.cidrBlock(vpcCidr)
.build());
}
for (var i = 0; i < (securityGroupId == "" ? 1 : 0); i++) {
new SecurityGroup("defaultSecurityGroup-" + i, SecurityGroupArgs.builder()
.name(securityGroupName)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// VSwitch Resource for Module
for (var i = 0; i < (vswitchId == "" ? 1 : 0); i++) {
new Switch("vswitch-" + i, SwitchArgs.builder()
.availabilityZone(availabilityZone == "" ? defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()) : availabilityZone)
.vswitchName(vswitchName)
.cidrBlock(vswitchCidr)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// Ram role Resource for Module
var defaultRole = new Role("defaultRole", RoleArgs.builder()
.name(ramName)
.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)
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.name("terraform-resize-cluster-test")
.emrVer(default_.mainVersions()[0].emrVersion())
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.hostGroups(
ClusterHostGroupArgs.builder()
.hostGroupName("master_group")
.hostGroupType("MASTER")
.nodeCount("2")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("1")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build(),
ClusterHostGroupArgs.builder()
.hostGroupName("core_group")
.hostGroupType("CORE")
.nodeCount("3")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("4")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build(),
ClusterHostGroupArgs.builder()
.hostGroupName("task_group")
.hostGroupType("TASK")
.nodeCount("4")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("4")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build())
.highAvailabilityEnable(true)
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.securityGroupId(securityGroupId == "" ? defaultSecurityGroup[0].id() : securityGroupId)
.isOpenPublicIp(true)
.chargeType("PostPaid")
.vswitchId(vswitchId == "" ? vswitch[0].id() : vswitchId)
.userDefinedEmrEcsRole(defaultRole.name())
.sshEnable(true)
.masterPwd("ABCtest1234!")
.build());
}
}
Coming soon!
3. Scale Down
In the case of scaling down a cluster, we need to specified the host group and the instance list.
NOTE: Graceful decommission of hadoop cluster has been supported Available in 1.168.0+.
The following is an example. We scale down the cluster by decreasing the node count by 2, and specifying the scale-down instance list.
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const default = alicloud.emr.getMainVersions({});
const defaultGetInstanceTypes = _default.then(_default => alicloud.emr.getInstanceTypes({
destinationResource: "InstanceType",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
supportLocalStorage: false,
instanceChargeType: "PostPaid",
supportNodeTypes: [
"MASTER",
"CORE",
"TASK",
],
}));
const dataDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "DataDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const systemDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "SystemDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[] = [];
for (const range = {value: 0}; range.value < (vpcId == "" ? 1 : 0); range.value++) {
vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {
name: vpcName,
cidrBlock: vpcCidr,
}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[] = [];
for (const range = {value: 0}; range.value < (securityGroupId == "" ? 1 : 0); range.value++) {
defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`default-${range.value}`, {
name: securityGroupName,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[] = [];
for (const range = {value: 0}; range.value < (vswitchId == "" ? 1 : 0); range.value++) {
vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
availabilityZone: availabilityZone == "" ? defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId) : availabilityZone,
vswitchName: vswitchName,
cidrBlock: vswitchCidr,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("default", {
name: ramName,
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("default", {
name: "terraform-resize-cluster-test",
emrVer: _default.then(_default => _default.mainVersions?.[0]?.emrVersion),
clusterType: _default.then(_default => _default.mainVersions?.[0]?.clusterTypes?.[0]),
hostGroups: [
{
hostGroupName: "master_group",
hostGroupType: "MASTER",
nodeCount: "2",
instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId),
securityGroupId: securityGroupId == "" ? defaultSecurityGroup[0].id : securityGroupId,
isOpenPublicIp: true,
chargeType: "PostPaid",
vswitchId: vswitchId == "" ? vswitch[0].id : vswitchId,
userDefinedEmrEcsRole: defaultRole.name,
sshEnable: true,
masterPwd: "ABCtest1234!",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.emr.get_main_versions()
default_get_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
cluster_type=default.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[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
cluster_type=default.main_versions[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if vpc_id == else 0)]:
vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}",
name=vpc_name,
cidr_block=vpc_cidr))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if security_group_id == else 0)]:
default_security_group.append(alicloud.ecs.SecurityGroup(f"default-{range['value']}",
name=security_group_name,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if vswitch_id == else 0)]:
vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
availability_zone=default_get_instance_types.types[0].zone_id if availability_zone == "" else availability_zone,
vswitch_name=vswitch_name,
cidr_block=vswitch_cidr,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# Ram role Resource for Module
default_role = alicloud.ram.Role("default",
name=ram_name,
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("default",
name="terraform-resize-cluster-test",
emr_ver=default.main_versions[0].emr_version,
cluster_type=default.main_versions[0].cluster_types[0],
host_groups=[
{
"host_group_name": "master_group",
"host_group_type": "MASTER",
"node_count": "2",
"instance_type": default_get_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",
},
{
"host_group_name": "core_group",
"host_group_type": "CORE",
"node_count": "3",
"instance_type": default_get_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",
},
{
"host_group_name": "task_group",
"host_group_type": "TASK",
"node_count": "2",
"instance_type": default_get_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_get_instance_types.types[0].zone_id,
security_group_id=default_security_group[0].id if security_group_id == "" else security_group_id,
is_open_public_ip=True,
charge_type="PostPaid",
vswitch_id=vswitch[0].id if vswitch_id == "" else vswitch_id,
user_defined_emr_ecs_role=default_role.name,
ssh_enable=True,
master_pwd="ABCtest1234!")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/emr"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := emr.GetMainVersions(ctx, nil, nil)
if err != nil {
return err
}
defaultGetInstanceTypes, err := emr.GetInstanceTypes(ctx, &emr.GetInstanceTypesArgs{
DestinationResource: "InstanceType",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
SupportLocalStorage: pulumi.BoolRef(false),
InstanceChargeType: "PostPaid",
SupportNodeTypes: []string{
"MASTER",
"CORE",
"TASK",
},
}, nil)
if err != nil {
return err
}
dataDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "DataDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
systemDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "SystemDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
var tmp0 float64
if vpcId == "" {
tmp0 = 1
} else {
tmp0 = 0
}
var vpc []*vpc.Network
for index := 0; index < tmp0; index++ {
key0 := index
_ := index
__res, err := vpc.NewNetwork(ctx, fmt.Sprintf("vpc-%v", key0), &vpc.NetworkArgs{
Name: pulumi.Any(vpcName),
CidrBlock: pulumi.Any(vpcCidr),
})
if err != nil {
return err
}
vpc = append(vpc, __res)
}
var tmp1 pulumi.String
if vpcId == "" {
tmp1 = vpc[0].ID()
} else {
tmp1 = pulumi.Any(vpcId)
}
var tmp2 float64
if securityGroupId == "" {
tmp2 = 1
} else {
tmp2 = 0
}
var defaultSecurityGroup []*ecs.SecurityGroup
for index := 0; index < tmp2; index++ {
key0 := index
_ := index
__res, err := ecs.NewSecurityGroup(ctx, fmt.Sprintf("default-%v", key0), &ecs.SecurityGroupArgs{
Name: pulumi.Any(securityGroupName),
VpcId: pulumi.String(tmp1),
})
if err != nil {
return err
}
defaultSecurityGroup = append(defaultSecurityGroup, __res)
}
var tmp3 pulumi.String
if availabilityZone == "" {
tmp3 = pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId)
} else {
tmp3 = pulumi.Any(availabilityZone)
}
var tmp4 pulumi.String
if vpcId == "" {
tmp4 = vpc[0].ID()
} else {
tmp4 = pulumi.Any(vpcId)
}
// VSwitch Resource for Module
var tmp5 float64
if vswitchId == "" {
tmp5 = 1
} else {
tmp5 = 0
}
var vswitch []*vpc.Switch
for index := 0; index < tmp5; index++ {
key0 := index
_ := index
__res, err := vpc.NewSwitch(ctx, fmt.Sprintf("vswitch-%v", key0), &vpc.SwitchArgs{
AvailabilityZone: pulumi.String(tmp3),
VswitchName: pulumi.Any(vswitchName),
CidrBlock: pulumi.Any(vswitchCidr),
VpcId: pulumi.String(tmp4),
})
if err != nil {
return err
}
vswitch = append(vswitch, __res)
}
// Ram role Resource for Module
defaultRole, err := ram.NewRole(ctx, "default", &ram.RoleArgs{
Name: pulumi.Any(ramName),
Document: pulumi.String(` {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"emr.aliyuncs.com",
"ecs.aliyuncs.com"
]
}
}
],
"Version": "1"
}
`),
Description: pulumi.String("this is a role test."),
Force: pulumi.Bool(true),
})
if err != nil {
return err
}
var tmp6 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp6 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp6 = pulumi.String("160")
}
var tmp7 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp7 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp7 = pulumi.String("160")
}
var tmp8 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp8 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp8 = pulumi.String("160")
}
var tmp9 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp9 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp9 = pulumi.String("160")
}
var tmp10 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp10 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp10 = pulumi.String("160")
}
var tmp11 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp11 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp11 = pulumi.String("160")
}
var tmp12 pulumi.String
if securityGroupId == "" {
tmp12 = defaultSecurityGroup[0].ID()
} else {
tmp12 = pulumi.Any(securityGroupId)
}
var tmp13 pulumi.String
if vswitchId == "" {
tmp13 = vswitch[0].ID()
} else {
tmp13 = pulumi.Any(vswitchId)
}
_, err = emr.NewCluster(ctx, "default", &emr.ClusterArgs{
Name: pulumi.String("terraform-resize-cluster-test"),
EmrVer: pulumi.String(_default.MainVersions[0].EmrVersion),
ClusterType: pulumi.String(_default.MainVersions[0].ClusterTypes[0]),
HostGroups: emr.ClusterHostGroupArray{
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("master_group"),
HostGroupType: pulumi.String("MASTER"),
NodeCount: pulumi.String("2"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp6),
DiskCount: pulumi.String("1"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp7),
},
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("core_group"),
HostGroupType: pulumi.String("CORE"),
NodeCount: pulumi.String("3"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp8),
DiskCount: pulumi.String("4"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp9),
},
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("task_group"),
HostGroupType: pulumi.String("TASK"),
NodeCount: pulumi.String("2"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp10),
DiskCount: pulumi.String("4"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp11),
},
},
HighAvailabilityEnable: pulumi.Bool(true),
ZoneId: pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId),
SecurityGroupId: pulumi.String(tmp12),
IsOpenPublicIp: pulumi.Bool(true),
ChargeType: pulumi.String("PostPaid"),
VswitchId: pulumi.String(tmp13),
UserDefinedEmrEcsRole: defaultRole.Name,
SshEnable: pulumi.Bool(true),
MasterPwd: pulumi.String("ABCtest1234!"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Emr.GetMainVersions.Invoke();
var defaultGetInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
{
DestinationResource = "InstanceType",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
SupportLocalStorage = false,
InstanceChargeType = "PostPaid",
SupportNodeTypes = new[]
{
"MASTER",
"CORE",
"TASK",
},
});
var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "DataDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "SystemDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var vpc = new List<AliCloud.Vpc.Network>();
for (var rangeIndex = 0; rangeIndex < (vpcId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
{
Name = vpcName,
CidrBlock = vpcCidr,
}));
}
var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
for (var rangeIndex = 0; rangeIndex < (securityGroupId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"default-{range.Value}", new()
{
Name = securityGroupName,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// VSwitch Resource for Module
var vswitch = new List<AliCloud.Vpc.Switch>();
for (var rangeIndex = 0; rangeIndex < (vswitchId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
{
AvailabilityZone = availabilityZone == "" ? defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId) : availabilityZone,
VswitchName = vswitchName,
CidrBlock = vswitchCidr,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// Ram role Resource for Module
var defaultRole = new AliCloud.Ram.Role("default", new()
{
Name = ramName,
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("default", new()
{
Name = "terraform-resize-cluster-test",
EmrVer = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.EmrVersion)),
ClusterType = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0])),
HostGroups = new[]
{
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "master_group",
HostGroupType = "MASTER",
NodeCount = "2",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "1",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "core_group",
HostGroupType = "CORE",
NodeCount = "3",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "4",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "task_group",
HostGroupType = "TASK",
NodeCount = "2",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "4",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
},
HighAvailabilityEnable = true,
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
SecurityGroupId = securityGroupId == "" ? defaultSecurityGroup[0].Id : securityGroupId,
IsOpenPublicIp = true,
ChargeType = "PostPaid",
VswitchId = vswitchId == "" ? vswitch[0].Id : vswitchId,
UserDefinedEmrEcsRole = defaultRole.Name,
SshEnable = true,
MasterPwd = "ABCtest1234!",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.emr.EmrFunctions;
import com.pulumi.alicloud.emr.inputs.GetMainVersionsArgs;
import com.pulumi.alicloud.emr.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.emr.inputs.GetDiskTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ram.Role;
import com.pulumi.alicloud.ram.RoleArgs;
import com.pulumi.alicloud.emr.Cluster;
import com.pulumi.alicloud.emr.ClusterArgs;
import com.pulumi.alicloud.emr.inputs.ClusterHostGroupArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = EmrFunctions.getMainVersions();
final var defaultGetInstanceTypes = EmrFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.destinationResource("InstanceType")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.supportLocalStorage(false)
.instanceChargeType("PostPaid")
.supportNodeTypes(
"MASTER",
"CORE",
"TASK")
.build());
final var dataDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("DataDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
final var systemDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("SystemDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
for (var i = 0; i < (vpcId == "" ? 1 : 0); i++) {
new Network("vpc-" + i, NetworkArgs.builder()
.name(vpcName)
.cidrBlock(vpcCidr)
.build());
}
for (var i = 0; i < (securityGroupId == "" ? 1 : 0); i++) {
new SecurityGroup("defaultSecurityGroup-" + i, SecurityGroupArgs.builder()
.name(securityGroupName)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// VSwitch Resource for Module
for (var i = 0; i < (vswitchId == "" ? 1 : 0); i++) {
new Switch("vswitch-" + i, SwitchArgs.builder()
.availabilityZone(availabilityZone == "" ? defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()) : availabilityZone)
.vswitchName(vswitchName)
.cidrBlock(vswitchCidr)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// Ram role Resource for Module
var defaultRole = new Role("defaultRole", RoleArgs.builder()
.name(ramName)
.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)
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.name("terraform-resize-cluster-test")
.emrVer(default_.mainVersions()[0].emrVersion())
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.hostGroups(
ClusterHostGroupArgs.builder()
.hostGroupName("master_group")
.hostGroupType("MASTER")
.nodeCount("2")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("1")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build(),
ClusterHostGroupArgs.builder()
.hostGroupName("core_group")
.hostGroupType("CORE")
.nodeCount("3")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("4")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build(),
ClusterHostGroupArgs.builder()
.hostGroupName("task_group")
.hostGroupType("TASK")
.nodeCount("2")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("4")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build())
.highAvailabilityEnable(true)
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.securityGroupId(securityGroupId == "" ? defaultSecurityGroup[0].id() : securityGroupId)
.isOpenPublicIp(true)
.chargeType("PostPaid")
.vswitchId(vswitchId == "" ? vswitch[0].id() : vswitchId)
.userDefinedEmrEcsRole(defaultRole.name())
.sshEnable(true)
.masterPwd("ABCtest1234!")
.build());
}
}
Coming soon!
4. Create a emr gateway cluster
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const default = alicloud.emr.getMainVersions({});
const defaultGetInstanceTypes = _default.then(_default => alicloud.emr.getInstanceTypes({
destinationResource: "InstanceType",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
supportLocalStorage: false,
instanceChargeType: "PostPaid",
supportNodeTypes: ["GATEWAY"],
}));
const dataDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "DataDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const systemDisk = Promise.all([_default, defaultGetInstanceTypes, defaultGetInstanceTypes]).then(([_default, defaultGetInstanceTypes, defaultGetInstanceTypes1]) => alicloud.emr.getDiskTypes({
destinationResource: "SystemDisk",
clusterType: _default.mainVersions?.[0]?.clusterTypes?.[0],
instanceChargeType: "PostPaid",
instanceType: defaultGetInstanceTypes.types?.[0]?.id,
zoneId: defaultGetInstanceTypes1.types?.[0]?.zoneId,
}));
const vpc: alicloud.vpc.Network[] = [];
for (const range = {value: 0}; range.value < (vpcId == "" ? 1 : 0); range.value++) {
vpc.push(new alicloud.vpc.Network(`vpc-${range.value}`, {
name: vpcName,
cidrBlock: vpcCidr,
}));
}
const defaultSecurityGroup: alicloud.ecs.SecurityGroup[] = [];
for (const range = {value: 0}; range.value < (securityGroupId == "" ? 1 : 0); range.value++) {
defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`default-${range.value}`, {
name: securityGroupName,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// VSwitch Resource for Module
const vswitch: alicloud.vpc.Switch[] = [];
for (const range = {value: 0}; range.value < (vswitchId == "" ? 1 : 0); range.value++) {
vswitch.push(new alicloud.vpc.Switch(`vswitch-${range.value}`, {
availabilityZone: availabilityZone == "" ? defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId) : availabilityZone,
vswitchName: vswitchName,
cidrBlock: vswitchCidr,
vpcId: vpcId == "" ? vpc[0].id : vpcId,
}));
}
// Ram role Resource for Module
const defaultRole = new alicloud.ram.Role("default", {
name: ramName,
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", {
name: "terraform-gateway-cluster-test",
emrVer: _default.then(_default => _default.mainVersions?.[0]?.emrVersion),
clusterType: "GATEWAY",
hostGroups: [{
hostGroupName: "master_group",
hostGroupType: "GATEWAY",
nodeCount: "1",
instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.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: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.types?.[0]?.zoneId),
securityGroupId: securityGroupId == "" ? defaultSecurityGroup[0].id : securityGroupId,
isOpenPublicIp: true,
chargeType: "PostPaid",
vswitchId: vswitchId == "" ? vswitch[0].id : vswitchId,
userDefinedEmrEcsRole: defaultRole.name,
sshEnable: true,
masterPwd: "ABCtest1234!",
relatedClusterId: relatedClusterId,
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.emr.get_main_versions()
default_get_instance_types = alicloud.emr.get_instance_types(destination_resource="InstanceType",
cluster_type=default.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[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
system_disk = alicloud.emr.get_disk_types(destination_resource="SystemDisk",
cluster_type=default.main_versions[0].cluster_types[0],
instance_charge_type="PostPaid",
instance_type=default_get_instance_types.types[0].id,
zone_id=default_get_instance_types.types[0].zone_id)
vpc = []
for range in [{"value": i} for i in range(0, 1 if vpc_id == else 0)]:
vpc.append(alicloud.vpc.Network(f"vpc-{range['value']}",
name=vpc_name,
cidr_block=vpc_cidr))
default_security_group = []
for range in [{"value": i} for i in range(0, 1 if security_group_id == else 0)]:
default_security_group.append(alicloud.ecs.SecurityGroup(f"default-{range['value']}",
name=security_group_name,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# VSwitch Resource for Module
vswitch = []
for range in [{"value": i} for i in range(0, 1 if vswitch_id == else 0)]:
vswitch.append(alicloud.vpc.Switch(f"vswitch-{range['value']}",
availability_zone=default_get_instance_types.types[0].zone_id if availability_zone == "" else availability_zone,
vswitch_name=vswitch_name,
cidr_block=vswitch_cidr,
vpc_id=vpc[0].id if vpc_id == "" else vpc_id))
# Ram role Resource for Module
default_role = alicloud.ram.Role("default",
name=ram_name,
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",
name="terraform-gateway-cluster-test",
emr_ver=default.main_versions[0].emr_version,
cluster_type="GATEWAY",
host_groups=[{
"host_group_name": "master_group",
"host_group_type": "GATEWAY",
"node_count": "1",
"instance_type": default_get_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_get_instance_types.types[0].zone_id,
security_group_id=default_security_group[0].id if security_group_id == "" else security_group_id,
is_open_public_ip=True,
charge_type="PostPaid",
vswitch_id=vswitch[0].id if vswitch_id == "" else vswitch_id,
user_defined_emr_ecs_role=default_role.name,
ssh_enable=True,
master_pwd="ABCtest1234!",
related_cluster_id=related_cluster_id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/emr"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := emr.GetMainVersions(ctx, nil, nil)
if err != nil {
return err
}
defaultGetInstanceTypes, err := emr.GetInstanceTypes(ctx, &emr.GetInstanceTypesArgs{
DestinationResource: "InstanceType",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
SupportLocalStorage: pulumi.BoolRef(false),
InstanceChargeType: "PostPaid",
SupportNodeTypes: []string{
"GATEWAY",
},
}, nil)
if err != nil {
return err
}
dataDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "DataDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
systemDisk, err := emr.GetDiskTypes(ctx, &emr.GetDiskTypesArgs{
DestinationResource: "SystemDisk",
ClusterType: _default.MainVersions[0].ClusterTypes[0],
InstanceChargeType: "PostPaid",
InstanceType: defaultGetInstanceTypes.Types[0].Id,
ZoneId: pulumi.StringRef(defaultGetInstanceTypes.Types[0].ZoneId),
}, nil)
if err != nil {
return err
}
var tmp0 float64
if vpcId == "" {
tmp0 = 1
} else {
tmp0 = 0
}
var vpc []*vpc.Network
for index := 0; index < tmp0; index++ {
key0 := index
_ := index
__res, err := vpc.NewNetwork(ctx, fmt.Sprintf("vpc-%v", key0), &vpc.NetworkArgs{
Name: pulumi.Any(vpcName),
CidrBlock: pulumi.Any(vpcCidr),
})
if err != nil {
return err
}
vpc = append(vpc, __res)
}
var tmp1 pulumi.String
if vpcId == "" {
tmp1 = vpc[0].ID()
} else {
tmp1 = pulumi.Any(vpcId)
}
var tmp2 float64
if securityGroupId == "" {
tmp2 = 1
} else {
tmp2 = 0
}
var defaultSecurityGroup []*ecs.SecurityGroup
for index := 0; index < tmp2; index++ {
key0 := index
_ := index
__res, err := ecs.NewSecurityGroup(ctx, fmt.Sprintf("default-%v", key0), &ecs.SecurityGroupArgs{
Name: pulumi.Any(securityGroupName),
VpcId: pulumi.String(tmp1),
})
if err != nil {
return err
}
defaultSecurityGroup = append(defaultSecurityGroup, __res)
}
var tmp3 pulumi.String
if availabilityZone == "" {
tmp3 = pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId)
} else {
tmp3 = pulumi.Any(availabilityZone)
}
var tmp4 pulumi.String
if vpcId == "" {
tmp4 = vpc[0].ID()
} else {
tmp4 = pulumi.Any(vpcId)
}
// VSwitch Resource for Module
var tmp5 float64
if vswitchId == "" {
tmp5 = 1
} else {
tmp5 = 0
}
var vswitch []*vpc.Switch
for index := 0; index < tmp5; index++ {
key0 := index
_ := index
__res, err := vpc.NewSwitch(ctx, fmt.Sprintf("vswitch-%v", key0), &vpc.SwitchArgs{
AvailabilityZone: pulumi.String(tmp3),
VswitchName: pulumi.Any(vswitchName),
CidrBlock: pulumi.Any(vswitchCidr),
VpcId: pulumi.String(tmp4),
})
if err != nil {
return err
}
vswitch = append(vswitch, __res)
}
// Ram role Resource for Module
defaultRole, err := ram.NewRole(ctx, "default", &ram.RoleArgs{
Name: pulumi.Any(ramName),
Document: pulumi.String(` {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"emr.aliyuncs.com",
"ecs.aliyuncs.com"
]
}
}
],
"Version": "1"
}
`),
Description: pulumi.String("this is a role test."),
Force: pulumi.Bool(true),
})
if err != nil {
return err
}
var tmp6 pulumi.String
if dataDisk.Types[0].Min > 160 {
tmp6 = pulumi.Int(dataDisk.Types[0].Min)
} else {
tmp6 = pulumi.String("160")
}
var tmp7 pulumi.String
if systemDisk.Types[0].Min > 160 {
tmp7 = pulumi.Int(systemDisk.Types[0].Min)
} else {
tmp7 = pulumi.String("160")
}
var tmp8 pulumi.String
if securityGroupId == "" {
tmp8 = defaultSecurityGroup[0].ID()
} else {
tmp8 = pulumi.Any(securityGroupId)
}
var tmp9 pulumi.String
if vswitchId == "" {
tmp9 = vswitch[0].ID()
} else {
tmp9 = pulumi.Any(vswitchId)
}
_, err = emr.NewCluster(ctx, "gateway", &emr.ClusterArgs{
Name: pulumi.String("terraform-gateway-cluster-test"),
EmrVer: pulumi.String(_default.MainVersions[0].EmrVersion),
ClusterType: pulumi.String("GATEWAY"),
HostGroups: emr.ClusterHostGroupArray{
&emr.ClusterHostGroupArgs{
HostGroupName: pulumi.String("master_group"),
HostGroupType: pulumi.String("GATEWAY"),
NodeCount: pulumi.String("1"),
InstanceType: pulumi.String(defaultGetInstanceTypes.Types[0].Id),
DiskType: pulumi.String(dataDisk.Types[0].Value),
DiskCapacity: pulumi.String(tmp6),
DiskCount: pulumi.String("1"),
SysDiskType: pulumi.String(systemDisk.Types[0].Value),
SysDiskCapacity: pulumi.String(tmp7),
},
},
HighAvailabilityEnable: pulumi.Bool(true),
ZoneId: pulumi.String(defaultGetInstanceTypes.Types[0].ZoneId),
SecurityGroupId: pulumi.String(tmp8),
IsOpenPublicIp: pulumi.Bool(true),
ChargeType: pulumi.String("PostPaid"),
VswitchId: pulumi.String(tmp9),
UserDefinedEmrEcsRole: defaultRole.Name,
SshEnable: pulumi.Bool(true),
MasterPwd: pulumi.String("ABCtest1234!"),
RelatedClusterId: pulumi.Any(relatedClusterId),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Emr.GetMainVersions.Invoke();
var defaultGetInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
{
DestinationResource = "InstanceType",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
SupportLocalStorage = false,
InstanceChargeType = "PostPaid",
SupportNodeTypes = new[]
{
"GATEWAY",
},
});
var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "DataDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
{
DestinationResource = "SystemDisk",
ClusterType = @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
InstanceChargeType = "PostPaid",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
});
var vpc = new List<AliCloud.Vpc.Network>();
for (var rangeIndex = 0; rangeIndex < (vpcId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
{
Name = vpcName,
CidrBlock = vpcCidr,
}));
}
var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
for (var rangeIndex = 0; rangeIndex < (securityGroupId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"default-{range.Value}", new()
{
Name = securityGroupName,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// VSwitch Resource for Module
var vswitch = new List<AliCloud.Vpc.Switch>();
for (var rangeIndex = 0; rangeIndex < (vswitchId == "" ? 1 : 0); rangeIndex++)
{
var range = new { Value = rangeIndex };
vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
{
AvailabilityZone = availabilityZone == "" ? defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId) : availabilityZone,
VswitchName = vswitchName,
CidrBlock = vswitchCidr,
VpcId = vpcId == "" ? vpc[0].Id : vpcId,
}));
}
// Ram role Resource for Module
var defaultRole = new AliCloud.Ram.Role("default", new()
{
Name = ramName,
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()
{
Name = "terraform-gateway-cluster-test",
EmrVer = @default.Apply(@default => @default.Apply(getMainVersionsResult => getMainVersionsResult.MainVersions[0]?.EmrVersion)),
ClusterType = "GATEWAY",
HostGroups = new[]
{
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
HostGroupName = "master_group",
HostGroupType = "GATEWAY",
NodeCount = "1",
InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.Id),
DiskType = dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
DiskCapacity = Output.Tuple(dataDisk, dataDisk).Apply(values =>
{
var dataDisk = values.Item1;
var dataDisk1 = values.Item2;
return dataDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? dataDisk1.Types[0]?.Min : 160;
}),
DiskCount = "1",
SysDiskType = systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Value),
SysDiskCapacity = Output.Tuple(systemDisk, systemDisk).Apply(values =>
{
var systemDisk = values.Item1;
var systemDisk1 = values.Item2;
return systemDisk.Apply(getDiskTypesResult => getDiskTypesResult.Types[0]?.Min) > 160 ? systemDisk1.Types[0]?.Min : 160;
}),
},
},
HighAvailabilityEnable = true,
ZoneId = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.Types[0]?.ZoneId),
SecurityGroupId = securityGroupId == "" ? defaultSecurityGroup[0].Id : securityGroupId,
IsOpenPublicIp = true,
ChargeType = "PostPaid",
VswitchId = vswitchId == "" ? vswitch[0].Id : vswitchId,
UserDefinedEmrEcsRole = defaultRole.Name,
SshEnable = true,
MasterPwd = "ABCtest1234!",
RelatedClusterId = relatedClusterId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.emr.EmrFunctions;
import com.pulumi.alicloud.emr.inputs.GetMainVersionsArgs;
import com.pulumi.alicloud.emr.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.emr.inputs.GetDiskTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ram.Role;
import com.pulumi.alicloud.ram.RoleArgs;
import com.pulumi.alicloud.emr.Cluster;
import com.pulumi.alicloud.emr.ClusterArgs;
import com.pulumi.alicloud.emr.inputs.ClusterHostGroupArgs;
import com.pulumi.codegen.internal.KeyedValue;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = EmrFunctions.getMainVersions();
final var defaultGetInstanceTypes = EmrFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.destinationResource("InstanceType")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.supportLocalStorage(false)
.instanceChargeType("PostPaid")
.supportNodeTypes("GATEWAY")
.build());
final var dataDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("DataDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
final var systemDisk = EmrFunctions.getDiskTypes(GetDiskTypesArgs.builder()
.destinationResource("SystemDisk")
.clusterType(default_.mainVersions()[0].clusterTypes()[0])
.instanceChargeType("PostPaid")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.build());
for (var i = 0; i < (vpcId == "" ? 1 : 0); i++) {
new Network("vpc-" + i, NetworkArgs.builder()
.name(vpcName)
.cidrBlock(vpcCidr)
.build());
}
for (var i = 0; i < (securityGroupId == "" ? 1 : 0); i++) {
new SecurityGroup("defaultSecurityGroup-" + i, SecurityGroupArgs.builder()
.name(securityGroupName)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// VSwitch Resource for Module
for (var i = 0; i < (vswitchId == "" ? 1 : 0); i++) {
new Switch("vswitch-" + i, SwitchArgs.builder()
.availabilityZone(availabilityZone == "" ? defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()) : availabilityZone)
.vswitchName(vswitchName)
.cidrBlock(vswitchCidr)
.vpcId(vpcId == "" ? vpc[0].id() : vpcId)
.build());
}
// Ram role Resource for Module
var defaultRole = new Role("defaultRole", RoleArgs.builder()
.name(ramName)
.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)
.build());
var gateway = new Cluster("gateway", ClusterArgs.builder()
.name("terraform-gateway-cluster-test")
.emrVer(default_.mainVersions()[0].emrVersion())
.clusterType("GATEWAY")
.hostGroups(ClusterHostGroupArgs.builder()
.hostGroupName("master_group")
.hostGroupType("GATEWAY")
.nodeCount("1")
.instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].id()))
.diskType(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.diskCapacity(dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? dataDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.diskCount("1")
.sysDiskType(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].value()))
.sysDiskCapacity(systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) > 160 ? systemDisk.applyValue(getDiskTypesResult -> getDiskTypesResult.types()[0].min()) : 160)
.build())
.highAvailabilityEnable(true)
.zoneId(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.types()[0].zoneId()))
.securityGroupId(securityGroupId == "" ? defaultSecurityGroup[0].id() : securityGroupId)
.isOpenPublicIp(true)
.chargeType("PostPaid")
.vswitchId(vswitchId == "" ? vswitch[0].id() : vswitchId)
.userDefinedEmrEcsRole(defaultRole.name())
.sshEnable(true)
.masterPwd("ABCtest1234!")
.relatedClusterId(relatedClusterId)
.build());
}
}
Coming soon!
Create Cluster Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Cluster(name: string, args: ClusterArgs, opts?: CustomResourceOptions);
@overload
def Cluster(resource_name: str,
args: ClusterArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Cluster(resource_name: str,
opts: Optional[ResourceOptions] = None,
emr_ver: Optional[str] = None,
zone_id: Optional[str] = None,
cluster_type: Optional[str] = None,
meta_store_conf: Optional[ClusterMetaStoreConfArgs] = None,
modify_cluster_service_config: Optional[ClusterModifyClusterServiceConfigArgs] = None,
eas_enable: Optional[bool] = None,
configs: Optional[Sequence[ClusterConfigArgs]] = 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,
bootstrap_actions: Optional[Sequence[ClusterBootstrapActionArgs]] = None,
meta_store_type: Optional[str] = None,
deposit_type: Optional[str] = None,
name: Optional[str] = None,
option_software_lists: Optional[Sequence[str]] = None,
period: Optional[int] = None,
related_cluster_id: Optional[str] = None,
resource_group_id: Optional[str] = None,
security_group_id: Optional[str] = None,
ssh_enable: Optional[bool] = None,
tags: Optional[Mapping[str, str]] = None,
use_local_metadb: Optional[bool] = None,
user_defined_emr_ecs_role: Optional[str] = None,
vswitch_id: Optional[str] = None,
charge_type: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var exampleclusterResourceResourceFromEmrcluster = new AliCloud.Emr.Cluster("exampleclusterResourceResourceFromEmrcluster", new()
{
EmrVer = "string",
ZoneId = "string",
ClusterType = "string",
MetaStoreConf = new AliCloud.Emr.Inputs.ClusterMetaStoreConfArgs
{
DbPassword = "string",
DbUrl = "string",
DbUserName = "string",
},
ModifyClusterServiceConfig = new AliCloud.Emr.Inputs.ClusterModifyClusterServiceConfigArgs
{
ConfigParams = "string",
ServiceName = "string",
Comment = "string",
ConfigType = "string",
CustomConfigParams = "string",
GatewayClusterIdLists = new[]
{
"string",
},
GroupId = "string",
HostInstanceId = "string",
RefreshHostConfig = false,
},
EasEnable = false,
Configs = new[]
{
new AliCloud.Emr.Inputs.ClusterConfigArgs
{
ConfigKey = "string",
ConfigValue = "string",
FileName = "string",
ServiceName = "string",
},
},
HighAvailabilityEnable = false,
HostGroups = new[]
{
new AliCloud.Emr.Inputs.ClusterHostGroupArgs
{
AutoRenew = false,
ChargeType = "string",
DecommissionTimeout = 0,
DiskCapacity = "string",
DiskCount = "string",
DiskType = "string",
EnableGracefulDecommission = false,
GpuDriver = "string",
HostGroupName = "string",
HostGroupType = "string",
InstanceList = "string",
InstanceType = "string",
NodeCount = "string",
Period = 0,
SysDiskCapacity = "string",
SysDiskType = "string",
},
},
IsOpenPublicIp = false,
KeyPairName = "string",
MasterPwd = "string",
BootstrapActions = new[]
{
new AliCloud.Emr.Inputs.ClusterBootstrapActionArgs
{
Arg = "string",
ExecutionFailStrategy = "string",
ExecutionMoment = "string",
ExecutionTarget = "string",
Name = "string",
Path = "string",
},
},
MetaStoreType = "string",
DepositType = "string",
Name = "string",
OptionSoftwareLists = new[]
{
"string",
},
Period = 0,
RelatedClusterId = "string",
ResourceGroupId = "string",
SecurityGroupId = "string",
SshEnable = false,
Tags =
{
{ "string", "string" },
},
UseLocalMetadb = false,
UserDefinedEmrEcsRole = "string",
VswitchId = "string",
ChargeType = "string",
});
example, err := emr.NewCluster(ctx, "exampleclusterResourceResourceFromEmrcluster", &emr.ClusterArgs{
EmrVer: pulumi.String("string"),
ZoneId: pulumi.String("string"),
ClusterType: pulumi.String("string"),
MetaStoreConf: &emr.ClusterMetaStoreConfArgs{
DbPassword: pulumi.String("string"),
DbUrl: pulumi.String("string"),
DbUserName: pulumi.String("string"),
},
ModifyClusterServiceConfig: &emr.ClusterModifyClusterServiceConfigArgs{
ConfigParams: pulumi.String("string"),
ServiceName: pulumi.String("string"),
Comment: pulumi.String("string"),
ConfigType: pulumi.String("string"),
CustomConfigParams: pulumi.String("string"),
GatewayClusterIdLists: pulumi.StringArray{
pulumi.String("string"),
},
GroupId: pulumi.String("string"),
HostInstanceId: pulumi.String("string"),
RefreshHostConfig: pulumi.Bool(false),
},
EasEnable: pulumi.Bool(false),
Configs: emr.ClusterConfigArray{
&emr.ClusterConfigArgs{
ConfigKey: pulumi.String("string"),
ConfigValue: pulumi.String("string"),
FileName: pulumi.String("string"),
ServiceName: pulumi.String("string"),
},
},
HighAvailabilityEnable: pulumi.Bool(false),
HostGroups: emr.ClusterHostGroupArray{
&emr.ClusterHostGroupArgs{
AutoRenew: pulumi.Bool(false),
ChargeType: pulumi.String("string"),
DecommissionTimeout: pulumi.Int(0),
DiskCapacity: pulumi.String("string"),
DiskCount: pulumi.String("string"),
DiskType: pulumi.String("string"),
EnableGracefulDecommission: pulumi.Bool(false),
GpuDriver: pulumi.String("string"),
HostGroupName: pulumi.String("string"),
HostGroupType: pulumi.String("string"),
InstanceList: pulumi.String("string"),
InstanceType: pulumi.String("string"),
NodeCount: pulumi.String("string"),
Period: pulumi.Int(0),
SysDiskCapacity: pulumi.String("string"),
SysDiskType: pulumi.String("string"),
},
},
IsOpenPublicIp: pulumi.Bool(false),
KeyPairName: pulumi.String("string"),
MasterPwd: pulumi.String("string"),
BootstrapActions: emr.ClusterBootstrapActionArray{
&emr.ClusterBootstrapActionArgs{
Arg: pulumi.String("string"),
ExecutionFailStrategy: pulumi.String("string"),
ExecutionMoment: pulumi.String("string"),
ExecutionTarget: pulumi.String("string"),
Name: pulumi.String("string"),
Path: pulumi.String("string"),
},
},
MetaStoreType: pulumi.String("string"),
DepositType: pulumi.String("string"),
Name: pulumi.String("string"),
OptionSoftwareLists: pulumi.StringArray{
pulumi.String("string"),
},
Period: pulumi.Int(0),
RelatedClusterId: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
SecurityGroupId: pulumi.String("string"),
SshEnable: pulumi.Bool(false),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
UseLocalMetadb: pulumi.Bool(false),
UserDefinedEmrEcsRole: pulumi.String("string"),
VswitchId: pulumi.String("string"),
ChargeType: pulumi.String("string"),
})
var exampleclusterResourceResourceFromEmrcluster = new Cluster("exampleclusterResourceResourceFromEmrcluster", ClusterArgs.builder()
.emrVer("string")
.zoneId("string")
.clusterType("string")
.metaStoreConf(ClusterMetaStoreConfArgs.builder()
.dbPassword("string")
.dbUrl("string")
.dbUserName("string")
.build())
.modifyClusterServiceConfig(ClusterModifyClusterServiceConfigArgs.builder()
.configParams("string")
.serviceName("string")
.comment("string")
.configType("string")
.customConfigParams("string")
.gatewayClusterIdLists("string")
.groupId("string")
.hostInstanceId("string")
.refreshHostConfig(false)
.build())
.easEnable(false)
.configs(ClusterConfigArgs.builder()
.configKey("string")
.configValue("string")
.fileName("string")
.serviceName("string")
.build())
.highAvailabilityEnable(false)
.hostGroups(ClusterHostGroupArgs.builder()
.autoRenew(false)
.chargeType("string")
.decommissionTimeout(0)
.diskCapacity("string")
.diskCount("string")
.diskType("string")
.enableGracefulDecommission(false)
.gpuDriver("string")
.hostGroupName("string")
.hostGroupType("string")
.instanceList("string")
.instanceType("string")
.nodeCount("string")
.period(0)
.sysDiskCapacity("string")
.sysDiskType("string")
.build())
.isOpenPublicIp(false)
.keyPairName("string")
.masterPwd("string")
.bootstrapActions(ClusterBootstrapActionArgs.builder()
.arg("string")
.executionFailStrategy("string")
.executionMoment("string")
.executionTarget("string")
.name("string")
.path("string")
.build())
.metaStoreType("string")
.depositType("string")
.name("string")
.optionSoftwareLists("string")
.period(0)
.relatedClusterId("string")
.resourceGroupId("string")
.securityGroupId("string")
.sshEnable(false)
.tags(Map.of("string", "string"))
.useLocalMetadb(false)
.userDefinedEmrEcsRole("string")
.vswitchId("string")
.chargeType("string")
.build());
examplecluster_resource_resource_from_emrcluster = alicloud.emr.Cluster("exampleclusterResourceResourceFromEmrcluster",
emr_ver="string",
zone_id="string",
cluster_type="string",
meta_store_conf=alicloud.emr.ClusterMetaStoreConfArgs(
db_password="string",
db_url="string",
db_user_name="string",
),
modify_cluster_service_config=alicloud.emr.ClusterModifyClusterServiceConfigArgs(
config_params="string",
service_name="string",
comment="string",
config_type="string",
custom_config_params="string",
gateway_cluster_id_lists=["string"],
group_id="string",
host_instance_id="string",
refresh_host_config=False,
),
eas_enable=False,
configs=[alicloud.emr.ClusterConfigArgs(
config_key="string",
config_value="string",
file_name="string",
service_name="string",
)],
high_availability_enable=False,
host_groups=[alicloud.emr.ClusterHostGroupArgs(
auto_renew=False,
charge_type="string",
decommission_timeout=0,
disk_capacity="string",
disk_count="string",
disk_type="string",
enable_graceful_decommission=False,
gpu_driver="string",
host_group_name="string",
host_group_type="string",
instance_list="string",
instance_type="string",
node_count="string",
period=0,
sys_disk_capacity="string",
sys_disk_type="string",
)],
is_open_public_ip=False,
key_pair_name="string",
master_pwd="string",
bootstrap_actions=[alicloud.emr.ClusterBootstrapActionArgs(
arg="string",
execution_fail_strategy="string",
execution_moment="string",
execution_target="string",
name="string",
path="string",
)],
meta_store_type="string",
deposit_type="string",
name="string",
option_software_lists=["string"],
period=0,
related_cluster_id="string",
resource_group_id="string",
security_group_id="string",
ssh_enable=False,
tags={
"string": "string",
},
use_local_metadb=False,
user_defined_emr_ecs_role="string",
vswitch_id="string",
charge_type="string")
const exampleclusterResourceResourceFromEmrcluster = new alicloud.emr.Cluster("exampleclusterResourceResourceFromEmrcluster", {
emrVer: "string",
zoneId: "string",
clusterType: "string",
metaStoreConf: {
dbPassword: "string",
dbUrl: "string",
dbUserName: "string",
},
modifyClusterServiceConfig: {
configParams: "string",
serviceName: "string",
comment: "string",
configType: "string",
customConfigParams: "string",
gatewayClusterIdLists: ["string"],
groupId: "string",
hostInstanceId: "string",
refreshHostConfig: false,
},
easEnable: false,
configs: [{
configKey: "string",
configValue: "string",
fileName: "string",
serviceName: "string",
}],
highAvailabilityEnable: false,
hostGroups: [{
autoRenew: false,
chargeType: "string",
decommissionTimeout: 0,
diskCapacity: "string",
diskCount: "string",
diskType: "string",
enableGracefulDecommission: false,
gpuDriver: "string",
hostGroupName: "string",
hostGroupType: "string",
instanceList: "string",
instanceType: "string",
nodeCount: "string",
period: 0,
sysDiskCapacity: "string",
sysDiskType: "string",
}],
isOpenPublicIp: false,
keyPairName: "string",
masterPwd: "string",
bootstrapActions: [{
arg: "string",
executionFailStrategy: "string",
executionMoment: "string",
executionTarget: "string",
name: "string",
path: "string",
}],
metaStoreType: "string",
depositType: "string",
name: "string",
optionSoftwareLists: ["string"],
period: 0,
relatedClusterId: "string",
resourceGroupId: "string",
securityGroupId: "string",
sshEnable: false,
tags: {
string: "string",
},
useLocalMetadb: false,
userDefinedEmrEcsRole: "string",
vswitchId: "string",
chargeType: "string",
});
type: alicloud:emr:Cluster
properties:
bootstrapActions:
- arg: string
executionFailStrategy: string
executionMoment: string
executionTarget: string
name: string
path: string
chargeType: string
clusterType: string
configs:
- configKey: string
configValue: string
fileName: string
serviceName: string
depositType: string
easEnable: false
emrVer: string
highAvailabilityEnable: false
hostGroups:
- autoRenew: false
chargeType: string
decommissionTimeout: 0
diskCapacity: string
diskCount: string
diskType: string
enableGracefulDecommission: false
gpuDriver: string
hostGroupName: string
hostGroupType: string
instanceList: string
instanceType: string
nodeCount: string
period: 0
sysDiskCapacity: string
sysDiskType: string
isOpenPublicIp: false
keyPairName: string
masterPwd: string
metaStoreConf:
dbPassword: string
dbUrl: string
dbUserName: string
metaStoreType: string
modifyClusterServiceConfig:
comment: string
configParams: string
configType: string
customConfigParams: string
gatewayClusterIdLists:
- string
groupId: string
hostInstanceId: string
refreshHostConfig: false
serviceName: string
name: string
optionSoftwareLists:
- string
period: 0
relatedClusterId: string
resourceGroupId: string
securityGroupId: string
sshEnable: false
tags:
string: string
useLocalMetadb: false
userDefinedEmrEcsRole: string
vswitchId: string
zoneId: string
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:
- Cluster
Type 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+.
- Emr
Ver string - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- Zone
Id string - Zone ID, e.g. cn-huhehaote-a
- Bootstrap
Actions List<Pulumi.Ali Cloud. Emr. Inputs. Cluster Bootstrap Action> - Boot action parameters.
- Charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- Configs
List<Pulumi.
Ali Cloud. Emr. Inputs. Cluster Config> - The custom configurations of emr-cluster service.
- Deposit
Type string - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- Eas
Enable bool - High security cluster (true) or not. Default value is false.
- High
Availability boolEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- Host
Groups List<Pulumi.Ali Cloud. Emr. Inputs. Cluster Host Group> - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- Is
Open boolPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- Key
Pair stringName - Ssh key pair.
- Master
Pwd string - Master ssh password.
- Meta
Store Pulumi.Conf Ali Cloud. Emr. Inputs. Cluster Meta Store Conf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- Meta
Store stringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- Modify
Cluster Pulumi.Service Config Ali Cloud. Emr. Inputs. Cluster Modify Cluster Service Config - The configurations of emr-cluster service modification after cluster created.
- Name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- Option
Software List<string>Lists - 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.
- string
- This specify the related cluster id, if this cluster is a Gateway.
- Resource
Group stringId - The Id of resource group which the emr-cluster belongs.
- Security
Group stringId - 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.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Use
Local boolMetadb - Use local metadb. Default is false.
- User
Defined stringEmr Ecs Role - 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 string - Global vswitch id, you can also specify it in host group.
- Cluster
Type 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+.
- Emr
Ver string - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- Zone
Id string - Zone ID, e.g. cn-huhehaote-a
- Bootstrap
Actions []ClusterBootstrap Action Args - Boot action parameters.
- Charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- Configs
[]Cluster
Config Args - The custom configurations of emr-cluster service.
- Deposit
Type string - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- Eas
Enable bool - High security cluster (true) or not. Default value is false.
- High
Availability boolEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- Host
Groups []ClusterHost Group Args - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- Is
Open boolPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- Key
Pair stringName - Ssh key pair.
- Master
Pwd string - Master ssh password.
- Meta
Store ClusterConf Meta Store Conf Args - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- Meta
Store stringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- Modify
Cluster ClusterService Config Modify Cluster Service Config Args - The configurations of emr-cluster service modification after cluster created.
- Name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- Option
Software []stringLists - 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.
- string
- This specify the related cluster id, if this cluster is a Gateway.
- Resource
Group stringId - The Id of resource group which the emr-cluster belongs.
- Security
Group stringId - 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.
- map[string]string
- A mapping of tags to assign to the resource.
- Use
Local boolMetadb - Use local metadb. Default is false.
- User
Defined stringEmr Ecs Role - 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 string - Global vswitch id, you can also specify it in host group.
- cluster
Type 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+.
- emr
Ver String - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- zone
Id String - Zone ID, e.g. cn-huhehaote-a
- bootstrap
Actions List<ClusterBootstrap Action> - Boot action parameters.
- charge
Type String - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- configs
List<Cluster
Config> - The custom configurations of emr-cluster service.
- deposit
Type String - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- eas
Enable Boolean - High security cluster (true) or not. Default value is false.
- high
Availability BooleanEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host
Groups List<ClusterHost Group> - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is
Open BooleanPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key
Pair StringName - Ssh key pair.
- master
Pwd String - Master ssh password.
- meta
Store ClusterConf Meta Store Conf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta
Store StringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify
Cluster ClusterService Config Modify Cluster Service Config - The configurations of emr-cluster service modification after cluster created.
- name String
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option
Software List<String>Lists - 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.
- String
- This specify the related cluster id, if this cluster is a Gateway.
- resource
Group StringId - The Id of resource group which the emr-cluster belongs.
- security
Group StringId - Security Group ID for Cluster, you can also specify this key for each host group.
- ssh
Enable Boolean - If this is set true, we can ssh into cluster. Default value is false.
- Map<String,String>
- A mapping of tags to assign to the resource.
- use
Local BooleanMetadb - Use local metadb. Default is false.
- user
Defined StringEmr Ecs Role - 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 String - Global vswitch id, you can also specify it in host group.
- cluster
Type 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+.
- emr
Ver string - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- zone
Id string - Zone ID, e.g. cn-huhehaote-a
- bootstrap
Actions ClusterBootstrap Action[] - Boot action parameters.
- charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- configs
Cluster
Config[] - The custom configurations of emr-cluster service.
- deposit
Type string - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- eas
Enable boolean - High security cluster (true) or not. Default value is false.
- high
Availability booleanEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host
Groups ClusterHost Group[] - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is
Open booleanPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key
Pair stringName - Ssh key pair.
- master
Pwd string - Master ssh password.
- meta
Store ClusterConf Meta Store Conf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta
Store stringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify
Cluster ClusterService Config Modify Cluster Service Config - The configurations of emr-cluster service modification after cluster created.
- name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option
Software string[]Lists - 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.
- string
- This specify the related cluster id, if this cluster is a Gateway.
- resource
Group stringId - The Id of resource group which the emr-cluster belongs.
- security
Group stringId - Security Group ID for Cluster, you can also specify this key for each host group.
- ssh
Enable boolean - If this is set true, we can ssh into cluster. Default value is false.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- use
Local booleanMetadb - Use local metadb. Default is false.
- user
Defined stringEmr Ecs Role - 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 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[ClusterBootstrap Action Args] - Boot action parameters.
- charge_
type str - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- configs
Sequence[Cluster
Config Args] - The custom configurations of emr-cluster service.
- 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_ boolenable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host_
groups Sequence[ClusterHost Group Args] - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is_
open_ boolpublic_ ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key_
pair_ strname - Ssh key pair.
- master_
pwd str - Master ssh password.
- meta_
store_ Clusterconf Meta Store Conf Args - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta_
store_ strtype - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify_
cluster_ Clusterservice_ config Modify Cluster Service Config Args - The configurations of emr-cluster service modification after cluster created.
- name str
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option_
software_ Sequence[str]lists - 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.
- str
- This specify the related cluster id, if this cluster is a Gateway.
- resource_
group_ strid - The Id of resource group which the emr-cluster belongs.
- security_
group_ strid - 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.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- use_
local_ boolmetadb - Use local metadb. Default is false.
- user_
defined_ stremr_ ecs_ role - 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.
- cluster
Type 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+.
- emr
Ver String - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- zone
Id String - Zone ID, e.g. cn-huhehaote-a
- bootstrap
Actions List<Property Map> - Boot action parameters.
- charge
Type String - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- configs List<Property Map>
- The custom configurations of emr-cluster service.
- deposit
Type String - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- eas
Enable Boolean - High security cluster (true) or not. Default value is false.
- high
Availability BooleanEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host
Groups List<Property Map> - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is
Open BooleanPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key
Pair StringName - Ssh key pair.
- master
Pwd String - Master ssh password.
- meta
Store Property MapConf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta
Store StringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify
Cluster Property MapService Config - The configurations of emr-cluster service modification after cluster created.
- name String
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option
Software List<String>Lists - 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.
- String
- This specify the related cluster id, if this cluster is a Gateway.
- resource
Group StringId - The Id of resource group which the emr-cluster belongs.
- security
Group StringId - Security Group ID for Cluster, you can also specify this key for each host group.
- ssh
Enable Boolean - If this is set true, we can ssh into cluster. Default value is false.
- Map<String>
- A mapping of tags to assign to the resource.
- use
Local BooleanMetadb - Use local metadb. Default is false.
- user
Defined StringEmr Ecs Role - 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 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 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,
configs: Optional[Sequence[ClusterConfigArgs]] = 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,
meta_store_conf: Optional[ClusterMetaStoreConfArgs] = None,
meta_store_type: Optional[str] = None,
modify_cluster_service_config: Optional[ClusterModifyClusterServiceConfigArgs] = None,
name: Optional[str] = None,
option_software_lists: Optional[Sequence[str]] = None,
period: Optional[int] = None,
related_cluster_id: Optional[str] = None,
resource_group_id: Optional[str] = None,
security_group_id: Optional[str] = None,
ssh_enable: Optional[bool] = None,
tags: Optional[Mapping[str, str]] = 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.
- Bootstrap
Actions List<Pulumi.Ali Cloud. Emr. Inputs. Cluster Bootstrap Action> - Boot action parameters.
- Charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- Cluster
Type 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+.
- Configs
List<Pulumi.
Ali Cloud. Emr. Inputs. Cluster Config> - The custom configurations of emr-cluster service.
- Deposit
Type string - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- Eas
Enable bool - High security cluster (true) or not. Default value is false.
- Emr
Ver string - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- High
Availability boolEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- Host
Groups List<Pulumi.Ali Cloud. Emr. Inputs. Cluster Host Group> - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- Is
Open boolPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- Key
Pair stringName - Ssh key pair.
- Master
Pwd string - Master ssh password.
- Meta
Store Pulumi.Conf Ali Cloud. Emr. Inputs. Cluster Meta Store Conf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- Meta
Store stringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- Modify
Cluster Pulumi.Service Config Ali Cloud. Emr. Inputs. Cluster Modify Cluster Service Config - The configurations of emr-cluster service modification after cluster created.
- Name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- Option
Software List<string>Lists - 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.
- string
- This specify the related cluster id, if this cluster is a Gateway.
- Resource
Group stringId - The Id of resource group which the emr-cluster belongs.
- Security
Group stringId - 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.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Use
Local boolMetadb - Use local metadb. Default is false.
- User
Defined stringEmr Ecs Role - 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 string - Global vswitch id, you can also specify it in host group.
- Zone
Id string - Zone ID, e.g. cn-huhehaote-a
- Bootstrap
Actions []ClusterBootstrap Action Args - Boot action parameters.
- Charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- Cluster
Type 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+.
- Configs
[]Cluster
Config Args - The custom configurations of emr-cluster service.
- Deposit
Type string - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- Eas
Enable bool - High security cluster (true) or not. Default value is false.
- Emr
Ver string - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- High
Availability boolEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- Host
Groups []ClusterHost Group Args - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- Is
Open boolPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- Key
Pair stringName - Ssh key pair.
- Master
Pwd string - Master ssh password.
- Meta
Store ClusterConf Meta Store Conf Args - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- Meta
Store stringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- Modify
Cluster ClusterService Config Modify Cluster Service Config Args - The configurations of emr-cluster service modification after cluster created.
- Name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- Option
Software []stringLists - 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.
- string
- This specify the related cluster id, if this cluster is a Gateway.
- Resource
Group stringId - The Id of resource group which the emr-cluster belongs.
- Security
Group stringId - 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.
- map[string]string
- A mapping of tags to assign to the resource.
- Use
Local boolMetadb - Use local metadb. Default is false.
- User
Defined stringEmr Ecs Role - 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 string - Global vswitch id, you can also specify it in host group.
- Zone
Id string - Zone ID, e.g. cn-huhehaote-a
- bootstrap
Actions List<ClusterBootstrap Action> - Boot action parameters.
- charge
Type String - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- cluster
Type 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+.
- configs
List<Cluster
Config> - The custom configurations of emr-cluster service.
- deposit
Type String - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- eas
Enable Boolean - High security cluster (true) or not. Default value is false.
- emr
Ver String - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- high
Availability BooleanEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host
Groups List<ClusterHost Group> - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is
Open BooleanPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key
Pair StringName - Ssh key pair.
- master
Pwd String - Master ssh password.
- meta
Store ClusterConf Meta Store Conf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta
Store StringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify
Cluster ClusterService Config Modify Cluster Service Config - The configurations of emr-cluster service modification after cluster created.
- name String
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option
Software List<String>Lists - 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.
- String
- This specify the related cluster id, if this cluster is a Gateway.
- resource
Group StringId - The Id of resource group which the emr-cluster belongs.
- security
Group StringId - Security Group ID for Cluster, you can also specify this key for each host group.
- ssh
Enable Boolean - If this is set true, we can ssh into cluster. Default value is false.
- Map<String,String>
- A mapping of tags to assign to the resource.
- use
Local BooleanMetadb - Use local metadb. Default is false.
- user
Defined StringEmr Ecs Role - 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 String - Global vswitch id, you can also specify it in host group.
- zone
Id String - Zone ID, e.g. cn-huhehaote-a
- bootstrap
Actions ClusterBootstrap Action[] - Boot action parameters.
- charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- cluster
Type 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+.
- configs
Cluster
Config[] - The custom configurations of emr-cluster service.
- deposit
Type string - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- eas
Enable boolean - High security cluster (true) or not. Default value is false.
- emr
Ver string - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- high
Availability booleanEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host
Groups ClusterHost Group[] - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is
Open booleanPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key
Pair stringName - Ssh key pair.
- master
Pwd string - Master ssh password.
- meta
Store ClusterConf Meta Store Conf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta
Store stringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify
Cluster ClusterService Config Modify Cluster Service Config - The configurations of emr-cluster service modification after cluster created.
- name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option
Software string[]Lists - 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.
- string
- This specify the related cluster id, if this cluster is a Gateway.
- resource
Group stringId - The Id of resource group which the emr-cluster belongs.
- security
Group stringId - Security Group ID for Cluster, you can also specify this key for each host group.
- ssh
Enable boolean - If this is set true, we can ssh into cluster. Default value is false.
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- use
Local booleanMetadb - Use local metadb. Default is false.
- user
Defined stringEmr Ecs Role - 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 string - Global vswitch id, you can also specify it in host group.
- zone
Id string - Zone ID, e.g. cn-huhehaote-a
- bootstrap_
actions Sequence[ClusterBootstrap Action Args] - Boot action parameters.
- charge_
type str - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- 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+.
- configs
Sequence[Cluster
Config Args] - The custom configurations of emr-cluster service.
- 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_ boolenable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host_
groups Sequence[ClusterHost Group Args] - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is_
open_ boolpublic_ ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key_
pair_ strname - Ssh key pair.
- master_
pwd str - Master ssh password.
- meta_
store_ Clusterconf Meta Store Conf Args - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta_
store_ strtype - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify_
cluster_ Clusterservice_ config Modify Cluster Service Config Args - The configurations of emr-cluster service modification after cluster created.
- name str
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option_
software_ Sequence[str]lists - 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.
- str
- This specify the related cluster id, if this cluster is a Gateway.
- resource_
group_ strid - The Id of resource group which the emr-cluster belongs.
- security_
group_ strid - 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.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- use_
local_ boolmetadb - Use local metadb. Default is false.
- user_
defined_ stremr_ ecs_ role - 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
- bootstrap
Actions List<Property Map> - Boot action parameters.
- charge
Type String - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- cluster
Type 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+.
- configs List<Property Map>
- The custom configurations of emr-cluster service.
- deposit
Type String - Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
- eas
Enable Boolean - High security cluster (true) or not. Default value is false.
- emr
Ver String - EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
- high
Availability BooleanEnable - High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
- host
Groups List<Property Map> - Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
- is
Open BooleanPublic Ip - Whether the MASTER node has a public IP address enabled. Default value is false.
- key
Pair StringName - Ssh key pair.
- master
Pwd String - Master ssh password.
- meta
Store Property MapConf - The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
- meta
Store StringType - The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
- modify
Cluster Property MapService Config - The configurations of emr-cluster service modification after cluster created.
- name String
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- option
Software List<String>Lists - 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.
- String
- This specify the related cluster id, if this cluster is a Gateway.
- resource
Group StringId - The Id of resource group which the emr-cluster belongs.
- security
Group StringId - Security Group ID for Cluster, you can also specify this key for each host group.
- ssh
Enable Boolean - If this is set true, we can ssh into cluster. Default value is false.
- Map<String>
- A mapping of tags to assign to the resource.
- use
Local BooleanMetadb - Use local metadb. Default is false.
- user
Defined StringEmr Ecs Role - 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 String - Global vswitch id, you can also specify it in host group.
- zone
Id String - Zone ID, e.g. cn-huhehaote-a
Supporting Types
ClusterBootstrapAction, ClusterBootstrapActionArgs
- Arg string
- bootstrap action args, e.g. "--a=b".
- Execution
Fail stringStrategy - bootstrap action execution fail strategy, ’FAILED_BLOCKED’ or ‘FAILED_CONTINUE’ . Default value: "FAILED_BLOCKED
- Execution
Moment string - bootstrap action execution moment, ’BEFORE_INSTALL’ or ‘AFTER_STARTED’ . Default value: "BEFORE_INSTALL".
- Execution
Target string - bootstrap action execution target, you can specify the host group name, e.g. "core_group". If this is not specified, the bootstrap action execution target is whole cluster.
- Name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- Path string
- bootstrap action path, e.g. "oss://bucket/path".
- Arg string
- bootstrap action args, e.g. "--a=b".
- Execution
Fail stringStrategy - bootstrap action execution fail strategy, ’FAILED_BLOCKED’ or ‘FAILED_CONTINUE’ . Default value: "FAILED_BLOCKED
- Execution
Moment string - bootstrap action execution moment, ’BEFORE_INSTALL’ or ‘AFTER_STARTED’ . Default value: "BEFORE_INSTALL".
- Execution
Target string - bootstrap action execution target, you can specify the host group name, e.g. "core_group". If this is not specified, the bootstrap action execution target is whole cluster.
- Name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- Path string
- bootstrap action path, e.g. "oss://bucket/path".
- arg String
- bootstrap action args, e.g. "--a=b".
- execution
Fail StringStrategy - bootstrap action execution fail strategy, ’FAILED_BLOCKED’ or ‘FAILED_CONTINUE’ . Default value: "FAILED_BLOCKED
- execution
Moment String - bootstrap action execution moment, ’BEFORE_INSTALL’ or ‘AFTER_STARTED’ . Default value: "BEFORE_INSTALL".
- execution
Target String - bootstrap action execution target, you can specify the host group name, e.g. "core_group". If this is not specified, the bootstrap action execution target is whole cluster.
- name String
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- path String
- bootstrap action path, e.g. "oss://bucket/path".
- arg string
- bootstrap action args, e.g. "--a=b".
- execution
Fail stringStrategy - bootstrap action execution fail strategy, ’FAILED_BLOCKED’ or ‘FAILED_CONTINUE’ . Default value: "FAILED_BLOCKED
- execution
Moment string - bootstrap action execution moment, ’BEFORE_INSTALL’ or ‘AFTER_STARTED’ . Default value: "BEFORE_INSTALL".
- execution
Target string - bootstrap action execution target, you can specify the host group name, e.g. "core_group". If this is not specified, the bootstrap action execution target is whole cluster.
- name string
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- path string
- bootstrap action path, e.g. "oss://bucket/path".
- arg str
- bootstrap action args, e.g. "--a=b".
- execution_
fail_ strstrategy - bootstrap action execution fail strategy, ’FAILED_BLOCKED’ or ‘FAILED_CONTINUE’ . Default value: "FAILED_BLOCKED
- execution_
moment str - bootstrap action execution moment, ’BEFORE_INSTALL’ or ‘AFTER_STARTED’ . Default value: "BEFORE_INSTALL".
- execution_
target str - bootstrap action execution target, you can specify the host group name, e.g. "core_group". If this is not specified, the bootstrap action execution target is whole cluster.
- name str
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- path str
- bootstrap action path, e.g. "oss://bucket/path".
- arg String
- bootstrap action args, e.g. "--a=b".
- execution
Fail StringStrategy - bootstrap action execution fail strategy, ’FAILED_BLOCKED’ or ‘FAILED_CONTINUE’ . Default value: "FAILED_BLOCKED
- execution
Moment String - bootstrap action execution moment, ’BEFORE_INSTALL’ or ‘AFTER_STARTED’ . Default value: "BEFORE_INSTALL".
- execution
Target String - bootstrap action execution target, you can specify the host group name, e.g. "core_group". If this is not specified, the bootstrap action execution target is whole cluster.
- name String
- The name of emr cluster. The name length must be less than 64. Supported characters: chinese character, english character, number, "-", "_".
- path String
- bootstrap action path, e.g. "oss://bucket/path".
ClusterConfig, ClusterConfigArgs
- Config
Key string - Custom configuration service config key, e.g. ’dfs.replication’.
- Config
Value string - Custom configuration service config value, e.g. ’3’.
- File
Name string - Custom configuration service file name, e.g. ’hdfs-site’.
- Service
Name string
- Config
Key string - Custom configuration service config key, e.g. ’dfs.replication’.
- Config
Value string - Custom configuration service config value, e.g. ’3’.
- File
Name string - Custom configuration service file name, e.g. ’hdfs-site’.
- Service
Name string
- config
Key String - Custom configuration service config key, e.g. ’dfs.replication’.
- config
Value String - Custom configuration service config value, e.g. ’3’.
- file
Name String - Custom configuration service file name, e.g. ’hdfs-site’.
- service
Name String
- config
Key string - Custom configuration service config key, e.g. ’dfs.replication’.
- config
Value string - Custom configuration service config value, e.g. ’3’.
- file
Name string - Custom configuration service file name, e.g. ’hdfs-site’.
- service
Name string
- config_
key str - Custom configuration service config key, e.g. ’dfs.replication’.
- config_
value str - Custom configuration service config value, e.g. ’3’.
- file_
name str - Custom configuration service file name, e.g. ’hdfs-site’.
- service_
name str
- config
Key String - Custom configuration service config key, e.g. ’dfs.replication’.
- config
Value String - Custom configuration service config value, e.g. ’3’.
- file
Name String - Custom configuration service file name, e.g. ’hdfs-site’.
- service
Name String
ClusterHostGroup, ClusterHostGroupArgs
- Auto
Renew bool - Auto renew for prepaid, ’true’ or ‘false’ . Default value: false.
- Charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- Decommission
Timeout int - Graceful decommission timeout, unit: seconds.
- Disk
Capacity string - Data disk capacity.
- Disk
Count string - Data disk count.
- Disk
Type string - Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.
- Enable
Graceful boolDecommission - Enable hadoop cluster of task node graceful decommission, ’true’ or ‘false’ . Default value: false.
- Gpu
Driver string - Host
Group stringName - host group name.
- Host
Group stringType - host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.
- Instance
List string - Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".
- Instance
Type string - Host Ecs instance type.
- Node
Count 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.
- Sys
Disk stringCapacity - System disk capacity.
- Sys
Disk stringType - System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.
- Auto
Renew bool - Auto renew for prepaid, ’true’ or ‘false’ . Default value: false.
- Charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- Decommission
Timeout int - Graceful decommission timeout, unit: seconds.
- Disk
Capacity string - Data disk capacity.
- Disk
Count string - Data disk count.
- Disk
Type string - Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.
- Enable
Graceful boolDecommission - Enable hadoop cluster of task node graceful decommission, ’true’ or ‘false’ . Default value: false.
- Gpu
Driver string - Host
Group stringName - host group name.
- Host
Group stringType - host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.
- Instance
List string - Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".
- Instance
Type string - Host Ecs instance type.
- Node
Count 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.
- Sys
Disk stringCapacity - System disk capacity.
- Sys
Disk stringType - System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.
- auto
Renew Boolean - Auto renew for prepaid, ’true’ or ‘false’ . Default value: false.
- charge
Type String - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- decommission
Timeout Integer - Graceful decommission timeout, unit: seconds.
- disk
Capacity String - Data disk capacity.
- disk
Count String - Data disk count.
- disk
Type String - Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.
- enable
Graceful BooleanDecommission - Enable hadoop cluster of task node graceful decommission, ’true’ or ‘false’ . Default value: false.
- gpu
Driver String - host
Group StringName - host group name.
- host
Group StringType - host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.
- instance
List String - Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".
- instance
Type String - Host Ecs instance type.
- node
Count 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.
- sys
Disk StringCapacity - System disk capacity.
- sys
Disk StringType - System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.
- auto
Renew boolean - Auto renew for prepaid, ’true’ or ‘false’ . Default value: false.
- charge
Type string - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- decommission
Timeout number - Graceful decommission timeout, unit: seconds.
- disk
Capacity string - Data disk capacity.
- disk
Count string - Data disk count.
- disk
Type string - Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.
- enable
Graceful booleanDecommission - Enable hadoop cluster of task node graceful decommission, ’true’ or ‘false’ . Default value: false.
- gpu
Driver string - host
Group stringName - host group name.
- host
Group stringType - host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.
- instance
List string - Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".
- instance
Type string - Host Ecs instance type.
- node
Count 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.
- sys
Disk stringCapacity - System disk capacity.
- sys
Disk stringType - System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.
- auto_
renew bool - Auto renew for prepaid, ’true’ or ‘false’ . Default value: false.
- charge_
type str - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- decommission_
timeout int - Graceful decommission timeout, unit: seconds.
- 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.
- enable_
graceful_ booldecommission - Enable hadoop cluster of task node graceful decommission, ’true’ or ‘false’ . Default value: false.
- gpu_
driver str - host_
group_ strname - host group name.
- host_
group_ strtype - 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_ strcapacity - System disk capacity.
- sys_
disk_ strtype - System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.
- auto
Renew Boolean - Auto renew for prepaid, ’true’ or ‘false’ . Default value: false.
- charge
Type String - Charge Type for this cluster. Supported value: PostPaid or PrePaid. Default value: PostPaid.
- decommission
Timeout Number - Graceful decommission timeout, unit: seconds.
- disk
Capacity String - Data disk capacity.
- disk
Count String - Data disk count.
- disk
Type String - Data disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,local_disk,cloud_essd.
- enable
Graceful BooleanDecommission - Enable hadoop cluster of task node graceful decommission, ’true’ or ‘false’ . Default value: false.
- gpu
Driver String - host
Group StringName - host group name.
- host
Group StringType - host group type, supported value: MASTER, CORE or TASK, supported 'GATEWAY' available in 1.61.0+.
- instance
List String - Instance list for cluster scale down. This value follows the json format, e.g. ["instance_id1","instance_id2"]. escape character for " is ".
- instance
Type String - Host Ecs instance type.
- node
Count 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.
- sys
Disk StringCapacity - System disk capacity.
- sys
Disk StringType - System disk type. Supported value: cloud,cloud_efficiency,cloud_ssd,cloud_essd.
ClusterMetaStoreConf, ClusterMetaStoreConfArgs
- Db
Password string - Custom rds database password.
- Db
Url string - Custom rds database connection url.
- Db
User stringName - Custom rds database user name.
- Db
Password string - Custom rds database password.
- Db
Url string - Custom rds database connection url.
- Db
User stringName - Custom rds database user name.
- db
Password String - Custom rds database password.
- db
Url String - Custom rds database connection url.
- db
User StringName - Custom rds database user name.
- db
Password string - Custom rds database password.
- db
Url string - Custom rds database connection url.
- db
User stringName - Custom rds database user name.
- db_
password str - Custom rds database password.
- db_
url str - Custom rds database connection url.
- db_
user_ strname - Custom rds database user name.
- db
Password String - Custom rds database password.
- db
Url String - Custom rds database connection url.
- db
User StringName - Custom rds database user name.
ClusterModifyClusterServiceConfig, ClusterModifyClusterServiceConfigArgs
- Config
Params string - Cluster service configuration modification params, e.g. ’{"hdfs-site":{"dfs.replication":"3"}}’.
- Service
Name string - Comment string
- Cluster service configuration modification comment, e.g. "Modify tez configuration".
- Config
Type string - Cluster service configuration modification type.
- Custom
Config stringParams - Cluster service configuration modification custom params, e.g. ’{"tez-site":{"key":{"Value":"value"}}}’.
- Gateway
Cluster List<string>Id Lists - Cluster service configuration modification related gateway cluster id list.
- Group
Id string - Cluster service configuration modification node group id, e.g. ’G-XXX’.
- Host
Instance stringId - Cluster service configuration modification host instance id, e.g. ’i-bp146tnrkq4tcxxxxx’.
- Refresh
Host boolConfig - Cluster service configuration modification refresh host config, ’true’ or ’false’.
- Config
Params string - Cluster service configuration modification params, e.g. ’{"hdfs-site":{"dfs.replication":"3"}}’.
- Service
Name string - Comment string
- Cluster service configuration modification comment, e.g. "Modify tez configuration".
- Config
Type string - Cluster service configuration modification type.
- Custom
Config stringParams - Cluster service configuration modification custom params, e.g. ’{"tez-site":{"key":{"Value":"value"}}}’.
- Gateway
Cluster []stringId Lists - Cluster service configuration modification related gateway cluster id list.
- Group
Id string - Cluster service configuration modification node group id, e.g. ’G-XXX’.
- Host
Instance stringId - Cluster service configuration modification host instance id, e.g. ’i-bp146tnrkq4tcxxxxx’.
- Refresh
Host boolConfig - Cluster service configuration modification refresh host config, ’true’ or ’false’.
- config
Params String - Cluster service configuration modification params, e.g. ’{"hdfs-site":{"dfs.replication":"3"}}’.
- service
Name String - comment String
- Cluster service configuration modification comment, e.g. "Modify tez configuration".
- config
Type String - Cluster service configuration modification type.
- custom
Config StringParams - Cluster service configuration modification custom params, e.g. ’{"tez-site":{"key":{"Value":"value"}}}’.
- gateway
Cluster List<String>Id Lists - Cluster service configuration modification related gateway cluster id list.
- group
Id String - Cluster service configuration modification node group id, e.g. ’G-XXX’.
- host
Instance StringId - Cluster service configuration modification host instance id, e.g. ’i-bp146tnrkq4tcxxxxx’.
- refresh
Host BooleanConfig - Cluster service configuration modification refresh host config, ’true’ or ’false’.
- config
Params string - Cluster service configuration modification params, e.g. ’{"hdfs-site":{"dfs.replication":"3"}}’.
- service
Name string - comment string
- Cluster service configuration modification comment, e.g. "Modify tez configuration".
- config
Type string - Cluster service configuration modification type.
- custom
Config stringParams - Cluster service configuration modification custom params, e.g. ’{"tez-site":{"key":{"Value":"value"}}}’.
- gateway
Cluster string[]Id Lists - Cluster service configuration modification related gateway cluster id list.
- group
Id string - Cluster service configuration modification node group id, e.g. ’G-XXX’.
- host
Instance stringId - Cluster service configuration modification host instance id, e.g. ’i-bp146tnrkq4tcxxxxx’.
- refresh
Host booleanConfig - Cluster service configuration modification refresh host config, ’true’ or ’false’.
- config_
params str - Cluster service configuration modification params, e.g. ’{"hdfs-site":{"dfs.replication":"3"}}’.
- service_
name str - comment str
- Cluster service configuration modification comment, e.g. "Modify tez configuration".
- config_
type str - Cluster service configuration modification type.
- custom_
config_ strparams - Cluster service configuration modification custom params, e.g. ’{"tez-site":{"key":{"Value":"value"}}}’.
- gateway_
cluster_ Sequence[str]id_ lists - Cluster service configuration modification related gateway cluster id list.
- group_
id str - Cluster service configuration modification node group id, e.g. ’G-XXX’.
- host_
instance_ strid - Cluster service configuration modification host instance id, e.g. ’i-bp146tnrkq4tcxxxxx’.
- refresh_
host_ boolconfig - Cluster service configuration modification refresh host config, ’true’ or ’false’.
- config
Params String - Cluster service configuration modification params, e.g. ’{"hdfs-site":{"dfs.replication":"3"}}’.
- service
Name String - comment String
- Cluster service configuration modification comment, e.g. "Modify tez configuration".
- config
Type String - Cluster service configuration modification type.
- custom
Config StringParams - Cluster service configuration modification custom params, e.g. ’{"tez-site":{"key":{"Value":"value"}}}’.
- gateway
Cluster List<String>Id Lists - Cluster service configuration modification related gateway cluster id list.
- group
Id String - Cluster service configuration modification node group id, e.g. ’G-XXX’.
- host
Instance StringId - Cluster service configuration modification host instance id, e.g. ’i-bp146tnrkq4tcxxxxx’.
- refresh
Host BooleanConfig - Cluster service configuration modification refresh host config, ’true’ or ’false’.
Import
Aliclioud E-MapReduce cluster can be imported using the id e.g.
$ pulumi import alicloud:emr/cluster:Cluster default C-B47FB8FE96C67XXXX
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.