<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Emr
{
    /// <summary>
    /// ## Example Usage
    /// ### 1. Create A Cluster
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultMainVersions = AliCloud.Emr.GetMainVersions.Invoke();
    /// 
    ///     var defaultInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "InstanceType",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         SupportLocalStorage = false,
    ///         InstanceChargeType = "PostPaid",
    ///         SupportNodeTypes = new[]
    ///         {
    ///             "MASTER",
    ///             "CORE",
    ///             "TASK",
    ///         },
    ///     });
    /// 
    ///     var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "DataDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "SystemDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var vpc = new List&lt;AliCloud.Vpc.Network&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
    ///         {
    ///             CidrBlock = @var.Vpc_cidr,
    ///         }));
    ///     }
    ///     var defaultSecurityGroup = new List&lt;AliCloud.Ecs.SecurityGroup&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new()
    ///         {
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // VSwitch Resource for Module
    ///     var vswitch = new List&lt;AliCloud.Vpc.Switch&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
    ///         {
    ///             AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId) : @var.Availability_zone,
    ///             VswitchName = @var.Vswitch_name,
    ///             CidrBlock = @var.Vswitch_cidr,
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // Ram role Resource for Module
    ///     var defaultRole = new AliCloud.Ram.Role("defaultRole", new()
    ///     {
    ///         Document = @"    {
    ///         ""Statement"": [
    ///         {
    ///             ""Action"": ""sts:AssumeRole"",
    ///             ""Effect"": ""Allow"",
    ///             ""Principal"": {
    ///             ""Service"": [
    ///                 ""emr.aliyuncs.com"",
    ///                 ""ecs.aliyuncs.com""
    ///             ]
    ///             }
    ///         }
    ///         ],
    ///         ""Version"": ""1""
    ///     }
    /// ",
    ///         Description = "this is a role test.",
    ///         Force = true,
    ///     });
    /// 
    ///     var defaultCluster = new AliCloud.Emr.Cluster("defaultCluster", new()
    ///     {
    ///         EmrVer = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.EmrVersion),
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         HostGroups = new[]
    ///         {
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "master_group",
    ///                 HostGroupType = "MASTER",
    ///                 NodeCount = "2",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "1",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "core_group",
    ///                 HostGroupType = "CORE",
    ///                 NodeCount = "3",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "4",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "task_group",
    ///                 HostGroupType = "TASK",
    ///                 NodeCount = "2",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "4",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///         },
    ///         HighAvailabilityEnable = true,
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///         SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
    ///         IsOpenPublicIp = true,
    ///         ChargeType = "PostPaid",
    ///         VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
    ///         UserDefinedEmrEcsRole = defaultRole.Name,
    ///         SshEnable = true,
    ///         MasterPwd = "ABCtest1234!",
    ///     });
    /// 
    /// });
    /// ```
    /// ### 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.
    /// 
    /// &gt; **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.
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultMainVersions = AliCloud.Emr.GetMainVersions.Invoke();
    /// 
    ///     var defaultInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "InstanceType",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         SupportLocalStorage = false,
    ///         InstanceChargeType = "PostPaid",
    ///         SupportNodeTypes = new[]
    ///         {
    ///             "MASTER",
    ///             "CORE",
    ///             "TASK",
    ///         },
    ///     });
    /// 
    ///     var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "DataDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "SystemDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var vpc = new List&lt;AliCloud.Vpc.Network&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
    ///         {
    ///             CidrBlock = @var.Vpc_cidr,
    ///         }));
    ///     }
    ///     var defaultSecurityGroup = new List&lt;AliCloud.Ecs.SecurityGroup&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new()
    ///         {
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // VSwitch Resource for Module
    ///     var vswitch = new List&lt;AliCloud.Vpc.Switch&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
    ///         {
    ///             AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId) : @var.Availability_zone,
    ///             VswitchName = @var.Vswitch_name,
    ///             CidrBlock = @var.Vswitch_cidr,
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // Ram role Resource for Module
    ///     var defaultRole = new AliCloud.Ram.Role("defaultRole", new()
    ///     {
    ///         Document = @"    {
    ///         ""Statement"": [
    ///         {
    ///             ""Action"": ""sts:AssumeRole"",
    ///             ""Effect"": ""Allow"",
    ///             ""Principal"": {
    ///             ""Service"": [
    ///                 ""emr.aliyuncs.com"",
    ///                 ""ecs.aliyuncs.com""
    ///             ]
    ///             }
    ///         }
    ///         ],
    ///         ""Version"": ""1""
    ///     }
    /// ",
    ///         Description = "this is a role test.",
    ///         Force = true,
    ///     });
    /// 
    ///     var defaultCluster = new AliCloud.Emr.Cluster("defaultCluster", new()
    ///     {
    ///         EmrVer = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.EmrVersion),
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         HostGroups = new[]
    ///         {
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "master_group",
    ///                 HostGroupType = "MASTER",
    ///                 NodeCount = "2",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "1",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "core_group",
    ///                 HostGroupType = "CORE",
    ///                 NodeCount = "3",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "4",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "task_group",
    ///                 HostGroupType = "TASK",
    ///                 NodeCount = "4",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "4",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///         },
    ///         HighAvailabilityEnable = true,
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///         SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
    ///         IsOpenPublicIp = true,
    ///         ChargeType = "PostPaid",
    ///         VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
    ///         UserDefinedEmrEcsRole = defaultRole.Name,
    ///         SshEnable = true,
    ///         MasterPwd = "ABCtest1234!",
    ///     });
    /// 
    /// });
    /// ```
    /// ### 3. Scale Down
    /// 
    /// In the case of scaling down a cluster, we need to specified the host group and the instance list.
    /// 
    /// &gt; **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.
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultMainVersions = AliCloud.Emr.GetMainVersions.Invoke();
    /// 
    ///     var defaultInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "InstanceType",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         SupportLocalStorage = false,
    ///         InstanceChargeType = "PostPaid",
    ///         SupportNodeTypes = new[]
    ///         {
    ///             "MASTER",
    ///             "CORE",
    ///             "TASK",
    ///         },
    ///     });
    /// 
    ///     var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "DataDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "SystemDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var vpc = new List&lt;AliCloud.Vpc.Network&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
    ///         {
    ///             CidrBlock = @var.Vpc_cidr,
    ///         }));
    ///     }
    ///     var defaultSecurityGroup = new List&lt;AliCloud.Ecs.SecurityGroup&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new()
    ///         {
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // VSwitch Resource for Module
    ///     var vswitch = new List&lt;AliCloud.Vpc.Switch&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
    ///         {
    ///             AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId) : @var.Availability_zone,
    ///             VswitchName = @var.Vswitch_name,
    ///             CidrBlock = @var.Vswitch_cidr,
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // Ram role Resource for Module
    ///     var defaultRole = new AliCloud.Ram.Role("defaultRole", new()
    ///     {
    ///         Document = @"    {
    ///         ""Statement"": [
    ///         {
    ///             ""Action"": ""sts:AssumeRole"",
    ///             ""Effect"": ""Allow"",
    ///             ""Principal"": {
    ///             ""Service"": [
    ///                 ""emr.aliyuncs.com"",
    ///                 ""ecs.aliyuncs.com""
    ///             ]
    ///             }
    ///         }
    ///         ],
    ///         ""Version"": ""1""
    ///     }
    /// ",
    ///         Description = "this is a role test.",
    ///         Force = true,
    ///     });
    /// 
    ///     var defaultCluster = new AliCloud.Emr.Cluster("defaultCluster", new()
    ///     {
    ///         EmrVer = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.EmrVersion),
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         HostGroups = new[]
    ///         {
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "master_group",
    ///                 HostGroupType = "MASTER",
    ///                 NodeCount = "2",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "1",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "core_group",
    ///                 HostGroupType = "CORE",
    ///                 NodeCount = "3",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "4",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "task_group",
    ///                 HostGroupType = "TASK",
    ///                 NodeCount = "2",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "4",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///         },
    ///         HighAvailabilityEnable = true,
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///         SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
    ///         IsOpenPublicIp = true,
    ///         ChargeType = "PostPaid",
    ///         VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
    ///         UserDefinedEmrEcsRole = defaultRole.Name,
    ///         SshEnable = true,
    ///         MasterPwd = "ABCtest1234!",
    ///     });
    /// 
    /// });
    /// ```
    /// ### 4. Create a emr gateway cluster
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var defaultMainVersions = AliCloud.Emr.GetMainVersions.Invoke();
    /// 
    ///     var defaultInstanceTypes = AliCloud.Emr.GetInstanceTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "InstanceType",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         SupportLocalStorage = false,
    ///         InstanceChargeType = "PostPaid",
    ///         SupportNodeTypes = new[]
    ///         {
    ///             "GATEWAY",
    ///         },
    ///     });
    /// 
    ///     var dataDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "DataDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var systemDisk = AliCloud.Emr.GetDiskTypes.Invoke(new()
    ///     {
    ///         DestinationResource = "SystemDisk",
    ///         ClusterType = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.ClusterTypes[0]),
    ///         InstanceChargeType = "PostPaid",
    ///         InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///     });
    /// 
    ///     var vpc = new List&lt;AliCloud.Vpc.Network&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vpc_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vpc.Add(new AliCloud.Vpc.Network($"vpc-{range.Value}", new()
    ///         {
    ///             CidrBlock = @var.Vpc_cidr,
    ///         }));
    ///     }
    ///     var defaultSecurityGroup = new List&lt;AliCloud.Ecs.SecurityGroup&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Security_group_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"defaultSecurityGroup-{range.Value}", new()
    ///         {
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // VSwitch Resource for Module
    ///     var vswitch = new List&lt;AliCloud.Vpc.Switch&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; (@var.Vswitch_id == "" ? 1 : 0 == true); rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         vswitch.Add(new AliCloud.Vpc.Switch($"vswitch-{range.Value}", new()
    ///         {
    ///             AvailabilityZone = @var.Availability_zone == "" ? defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId) : @var.Availability_zone,
    ///             VswitchName = @var.Vswitch_name,
    ///             CidrBlock = @var.Vswitch_cidr,
    ///             VpcId = @var.Vpc_id == "" ? vpc.Id : @var.Vpc_id,
    ///         }));
    ///     }
    ///     // Ram role Resource for Module
    ///     var defaultRole = new AliCloud.Ram.Role("defaultRole", new()
    ///     {
    ///         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()
    ///     {
    ///         EmrVer = defaultMainVersions.Apply(getMainVersionsResult =&gt; getMainVersionsResult.MainVersions[0]?.EmrVersion),
    ///         ClusterType = "GATEWAY",
    ///         HostGroups = new[]
    ///         {
    ///             new AliCloud.Emr.Inputs.ClusterHostGroupArgs
    ///             {
    ///                 HostGroupName = "master_group",
    ///                 HostGroupType = "GATEWAY",
    ///                 NodeCount = "1",
    ///                 InstanceType = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.Id),
    ///                 DiskType = dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 DiskCapacity = Output.Tuple(dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var dataDisk = values.Item1;
    ///                     var dataDisk1 = values.Item2;
    ///                     return dataDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? dataDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///                 DiskCount = "1",
    ///                 SysDiskType = systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Value),
    ///                 SysDiskCapacity = Output.Tuple(systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult), systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult)).Apply(values =&gt;
    ///                 {
    ///                     var systemDisk = values.Item1;
    ///                     var systemDisk1 = values.Item2;
    ///                     return systemDisk.Apply(getDiskTypesResult =&gt; getDiskTypesResult.Types[0]?.Min) &gt; 160 ? systemDisk1.Types[0]?.Min : 160;
    ///                 }),
    ///             },
    ///         },
    ///         HighAvailabilityEnable = true,
    ///         ZoneId = defaultInstanceTypes.Apply(getInstanceTypesResult =&gt; getInstanceTypesResult.Types[0]?.ZoneId),
    ///         SecurityGroupId = @var.Security_group_id == "" ? defaultSecurityGroup.Id : @var.Security_group_id,
    ///         IsOpenPublicIp = true,
    ///         ChargeType = "PostPaid",
    ///         VswitchId = @var.Vswitch_id == "" ? vswitch.Id : @var.Vswitch_id,
    ///         UserDefinedEmrEcsRole = defaultRole.Name,
    ///         SshEnable = true,
    ///         MasterPwd = "ABCtest1234!",
    ///         RelatedClusterId = related_cluster_id,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Aliclioud E-MapReduce cluster can be imported using the id e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:emr/cluster:Cluster default C-B47FB8FE96C67XXXX
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:emr/cluster:Cluster")]
    public partial class Cluster : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Boot action parameters.
        /// </summary>
        [Output("bootstrapActions")]
        public Output<ImmutableArray<Outputs.ClusterBootstrapAction>> BootstrapActions { get; private set; } = null!;

        /// <summary>
        /// Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.
        /// </summary>
        [Output("chargeType")]
        public Output<string?> ChargeType { get; private set; } = null!;

        /// <summary>
        /// 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+.
        /// </summary>
        [Output("clusterType")]
        public Output<string> ClusterType { get; private set; } = null!;

        /// <summary>
        /// The custom configurations of emr-cluster service.
        /// </summary>
        [Output("configs")]
        public Output<ImmutableArray<Outputs.ClusterConfig>> Configs { get; private set; } = null!;

        /// <summary>
        /// Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
        /// </summary>
        [Output("depositType")]
        public Output<string?> DepositType { get; private set; } = null!;

        /// <summary>
        /// High security cluster (true) or not. Default value is false.
        /// </summary>
        [Output("easEnable")]
        public Output<bool?> EasEnable { get; private set; } = null!;

        /// <summary>
        /// EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
        /// </summary>
        [Output("emrVer")]
        public Output<string> EmrVer { get; private set; } = null!;

        /// <summary>
        /// High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
        /// </summary>
        [Output("highAvailabilityEnable")]
        public Output<bool?> HighAvailabilityEnable { get; private set; } = null!;

        /// <summary>
        /// Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
        /// </summary>
        [Output("hostGroups")]
        public Output<ImmutableArray<Outputs.ClusterHostGroup>> HostGroups { get; private set; } = null!;

        /// <summary>
        /// Whether the MASTER node has a public IP address enabled. Default value is false.
        /// </summary>
        [Output("isOpenPublicIp")]
        public Output<bool?> IsOpenPublicIp { get; private set; } = null!;

        /// <summary>
        /// Ssh key pair.
        /// </summary>
        [Output("keyPairName")]
        public Output<string?> KeyPairName { get; private set; } = null!;

        /// <summary>
        /// Master ssh password.
        /// </summary>
        [Output("masterPwd")]
        public Output<string?> MasterPwd { get; private set; } = null!;

        /// <summary>
        /// The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
        /// </summary>
        [Output("metaStoreConf")]
        public Output<Outputs.ClusterMetaStoreConf?> MetaStoreConf { get; private set; } = null!;

        /// <summary>
        /// The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
        /// </summary>
        [Output("metaStoreType")]
        public Output<string> MetaStoreType { get; private set; } = null!;

        /// <summary>
        /// The configurations of emr-cluster service modification after cluster created.
        /// </summary>
        [Output("modifyClusterServiceConfig")]
        public Output<Outputs.ClusterModifyClusterServiceConfig?> ModifyClusterServiceConfig { get; private set; } = null!;

        /// <summary>
        /// bootstrap action name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Optional software list.
        /// </summary>
        [Output("optionSoftwareLists")]
        public Output<ImmutableArray<string>> OptionSoftwareLists { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("period")]
        public Output<int?> Period { get; private set; } = null!;

        /// <summary>
        /// This specify the related cluster id, if this cluster is a Gateway.
        /// </summary>
        [Output("relatedClusterId")]
        public Output<string?> RelatedClusterId { get; private set; } = null!;

        /// <summary>
        /// The Id of resource group which the emr-cluster belongs.
        /// </summary>
        [Output("resourceGroupId")]
        public Output<string?> ResourceGroupId { get; private set; } = null!;

        /// <summary>
        /// Security Group ID for Cluster, you can also specify this key for each host group.
        /// </summary>
        [Output("securityGroupId")]
        public Output<string?> SecurityGroupId { get; private set; } = null!;

        /// <summary>
        /// If this is set true, we can ssh into cluster. Default value is false.
        /// </summary>
        [Output("sshEnable")]
        public Output<bool?> SshEnable { get; private set; } = null!;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>> Tags { get; private set; } = null!;

        /// <summary>
        /// Use local metadb. Default is false.
        /// </summary>
        [Output("useLocalMetadb")]
        public Output<bool?> UseLocalMetadb { get; private set; } = null!;

        /// <summary>
        /// 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.
        /// </summary>
        [Output("userDefinedEmrEcsRole")]
        public Output<string?> UserDefinedEmrEcsRole { get; private set; } = null!;

        /// <summary>
        /// Global vswitch id, you can also specify it in host group.
        /// </summary>
        [Output("vswitchId")]
        public Output<string?> VswitchId { get; private set; } = null!;

        /// <summary>
        /// Zone ID, e.g. cn-huhehaote-a
        /// </summary>
        [Output("zoneId")]
        public Output<string> ZoneId { get; private set; } = null!;


        /// <summary>
        /// Create a Cluster resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Cluster(string name, ClusterArgs args, CustomResourceOptions? options = null)
            : base("alicloud:emr/cluster:Cluster", name, args ?? new ClusterArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Cluster(string name, Input<string> id, ClusterState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:emr/cluster:Cluster", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Cluster resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Cluster Get(string name, Input<string> id, ClusterState? state = null, CustomResourceOptions? options = null)
        {
            return new Cluster(name, id, state, options);
        }
    }

    public sealed class ClusterArgs : global::Pulumi.ResourceArgs
    {
        [Input("bootstrapActions")]
        private InputList<Inputs.ClusterBootstrapActionArgs>? _bootstrapActions;

        /// <summary>
        /// Boot action parameters.
        /// </summary>
        public InputList<Inputs.ClusterBootstrapActionArgs> BootstrapActions
        {
            get => _bootstrapActions ?? (_bootstrapActions = new InputList<Inputs.ClusterBootstrapActionArgs>());
            set => _bootstrapActions = value;
        }

        /// <summary>
        /// Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.
        /// </summary>
        [Input("chargeType")]
        public Input<string>? ChargeType { get; set; }

        /// <summary>
        /// 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+.
        /// </summary>
        [Input("clusterType", required: true)]
        public Input<string> ClusterType { get; set; } = null!;

        [Input("configs")]
        private InputList<Inputs.ClusterConfigArgs>? _configs;

        /// <summary>
        /// The custom configurations of emr-cluster service.
        /// </summary>
        public InputList<Inputs.ClusterConfigArgs> Configs
        {
            get => _configs ?? (_configs = new InputList<Inputs.ClusterConfigArgs>());
            set => _configs = value;
        }

        /// <summary>
        /// Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
        /// </summary>
        [Input("depositType")]
        public Input<string>? DepositType { get; set; }

        /// <summary>
        /// High security cluster (true) or not. Default value is false.
        /// </summary>
        [Input("easEnable")]
        public Input<bool>? EasEnable { get; set; }

        /// <summary>
        /// EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
        /// </summary>
        [Input("emrVer", required: true)]
        public Input<string> EmrVer { get; set; } = null!;

        /// <summary>
        /// High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
        /// </summary>
        [Input("highAvailabilityEnable")]
        public Input<bool>? HighAvailabilityEnable { get; set; }

        [Input("hostGroups")]
        private InputList<Inputs.ClusterHostGroupArgs>? _hostGroups;

        /// <summary>
        /// Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
        /// </summary>
        public InputList<Inputs.ClusterHostGroupArgs> HostGroups
        {
            get => _hostGroups ?? (_hostGroups = new InputList<Inputs.ClusterHostGroupArgs>());
            set => _hostGroups = value;
        }

        /// <summary>
        /// Whether the MASTER node has a public IP address enabled. Default value is false.
        /// </summary>
        [Input("isOpenPublicIp")]
        public Input<bool>? IsOpenPublicIp { get; set; }

        /// <summary>
        /// Ssh key pair.
        /// </summary>
        [Input("keyPairName")]
        public Input<string>? KeyPairName { get; set; }

        /// <summary>
        /// Master ssh password.
        /// </summary>
        [Input("masterPwd")]
        public Input<string>? MasterPwd { get; set; }

        /// <summary>
        /// The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
        /// </summary>
        [Input("metaStoreConf")]
        public Input<Inputs.ClusterMetaStoreConfArgs>? MetaStoreConf { get; set; }

        /// <summary>
        /// The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
        /// </summary>
        [Input("metaStoreType")]
        public Input<string>? MetaStoreType { get; set; }

        /// <summary>
        /// The configurations of emr-cluster service modification after cluster created.
        /// </summary>
        [Input("modifyClusterServiceConfig")]
        public Input<Inputs.ClusterModifyClusterServiceConfigArgs>? ModifyClusterServiceConfig { get; set; }

        /// <summary>
        /// bootstrap action name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("optionSoftwareLists")]
        private InputList<string>? _optionSoftwareLists;

        /// <summary>
        /// Optional software list.
        /// </summary>
        public InputList<string> OptionSoftwareLists
        {
            get => _optionSoftwareLists ?? (_optionSoftwareLists = new InputList<string>());
            set => _optionSoftwareLists = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// This specify the related cluster id, if this cluster is a Gateway.
        /// </summary>
        [Input("relatedClusterId")]
        public Input<string>? RelatedClusterId { get; set; }

        /// <summary>
        /// The Id of resource group which the emr-cluster belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// Security Group ID for Cluster, you can also specify this key for each host group.
        /// </summary>
        [Input("securityGroupId")]
        public Input<string>? SecurityGroupId { get; set; }

        /// <summary>
        /// If this is set true, we can ssh into cluster. Default value is false.
        /// </summary>
        [Input("sshEnable")]
        public Input<bool>? SshEnable { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// Use local metadb. Default is false.
        /// </summary>
        [Input("useLocalMetadb")]
        public Input<bool>? UseLocalMetadb { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("userDefinedEmrEcsRole")]
        public Input<string>? UserDefinedEmrEcsRole { get; set; }

        /// <summary>
        /// Global vswitch id, you can also specify it in host group.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// Zone ID, e.g. cn-huhehaote-a
        /// </summary>
        [Input("zoneId", required: true)]
        public Input<string> ZoneId { get; set; } = null!;

        public ClusterArgs()
        {
        }
        public static new ClusterArgs Empty => new ClusterArgs();
    }

    public sealed class ClusterState : global::Pulumi.ResourceArgs
    {
        [Input("bootstrapActions")]
        private InputList<Inputs.ClusterBootstrapActionGetArgs>? _bootstrapActions;

        /// <summary>
        /// Boot action parameters.
        /// </summary>
        public InputList<Inputs.ClusterBootstrapActionGetArgs> BootstrapActions
        {
            get => _bootstrapActions ?? (_bootstrapActions = new InputList<Inputs.ClusterBootstrapActionGetArgs>());
            set => _bootstrapActions = value;
        }

        /// <summary>
        /// Charge Type for this group of hosts: PostPaid or PrePaid. If this is not specified, charge type will follow global charge_type value.
        /// </summary>
        [Input("chargeType")]
        public Input<string>? ChargeType { get; set; }

        /// <summary>
        /// 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+.
        /// </summary>
        [Input("clusterType")]
        public Input<string>? ClusterType { get; set; }

        [Input("configs")]
        private InputList<Inputs.ClusterConfigGetArgs>? _configs;

        /// <summary>
        /// The custom configurations of emr-cluster service.
        /// </summary>
        public InputList<Inputs.ClusterConfigGetArgs> Configs
        {
            get => _configs ?? (_configs = new InputList<Inputs.ClusterConfigGetArgs>());
            set => _configs = value;
        }

        /// <summary>
        /// Cluster deposit type, HALF_MANAGED or FULL_MANAGED.
        /// </summary>
        [Input("depositType")]
        public Input<string>? DepositType { get; set; }

        /// <summary>
        /// High security cluster (true) or not. Default value is false.
        /// </summary>
        [Input("easEnable")]
        public Input<bool>? EasEnable { get; set; }

        /// <summary>
        /// EMR Version, e.g. EMR-3.22.0. You can find the all valid EMR Version in emr web console.
        /// </summary>
        [Input("emrVer")]
        public Input<string>? EmrVer { get; set; }

        /// <summary>
        /// High Available for HDFS and YARN. If this is set true, MASTER group must have two nodes.
        /// </summary>
        [Input("highAvailabilityEnable")]
        public Input<bool>? HighAvailabilityEnable { get; set; }

        [Input("hostGroups")]
        private InputList<Inputs.ClusterHostGroupGetArgs>? _hostGroups;

        /// <summary>
        /// Groups of Host, You can specify MASTER as a group, CORE as a group (just like the above example).
        /// </summary>
        public InputList<Inputs.ClusterHostGroupGetArgs> HostGroups
        {
            get => _hostGroups ?? (_hostGroups = new InputList<Inputs.ClusterHostGroupGetArgs>());
            set => _hostGroups = value;
        }

        /// <summary>
        /// Whether the MASTER node has a public IP address enabled. Default value is false.
        /// </summary>
        [Input("isOpenPublicIp")]
        public Input<bool>? IsOpenPublicIp { get; set; }

        /// <summary>
        /// Ssh key pair.
        /// </summary>
        [Input("keyPairName")]
        public Input<string>? KeyPairName { get; set; }

        /// <summary>
        /// Master ssh password.
        /// </summary>
        [Input("masterPwd")]
        public Input<string>? MasterPwd { get; set; }

        /// <summary>
        /// The configuration of emr-cluster service component metadata storage. If meta store type is ’user_rds’, this should be specified.
        /// </summary>
        [Input("metaStoreConf")]
        public Input<Inputs.ClusterMetaStoreConfGetArgs>? MetaStoreConf { get; set; }

        /// <summary>
        /// The type of emr-cluster service component metadata storage. ’dlf’ or ’local’ or ’user_rds’ .
        /// </summary>
        [Input("metaStoreType")]
        public Input<string>? MetaStoreType { get; set; }

        /// <summary>
        /// The configurations of emr-cluster service modification after cluster created.
        /// </summary>
        [Input("modifyClusterServiceConfig")]
        public Input<Inputs.ClusterModifyClusterServiceConfigGetArgs>? ModifyClusterServiceConfig { get; set; }

        /// <summary>
        /// bootstrap action name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("optionSoftwareLists")]
        private InputList<string>? _optionSoftwareLists;

        /// <summary>
        /// Optional software list.
        /// </summary>
        public InputList<string> OptionSoftwareLists
        {
            get => _optionSoftwareLists ?? (_optionSoftwareLists = new InputList<string>());
            set => _optionSoftwareLists = value;
        }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// This specify the related cluster id, if this cluster is a Gateway.
        /// </summary>
        [Input("relatedClusterId")]
        public Input<string>? RelatedClusterId { get; set; }

        /// <summary>
        /// The Id of resource group which the emr-cluster belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// Security Group ID for Cluster, you can also specify this key for each host group.
        /// </summary>
        [Input("securityGroupId")]
        public Input<string>? SecurityGroupId { get; set; }

        /// <summary>
        /// If this is set true, we can ssh into cluster. Default value is false.
        /// </summary>
        [Input("sshEnable")]
        public Input<bool>? SshEnable { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// Use local metadb. Default is false.
        /// </summary>
        [Input("useLocalMetadb")]
        public Input<bool>? UseLocalMetadb { get; set; }

        /// <summary>
        /// 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.
        /// </summary>
        [Input("userDefinedEmrEcsRole")]
        public Input<string>? UserDefinedEmrEcsRole { get; set; }

        /// <summary>
        /// Global vswitch id, you can also specify it in host group.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// Zone ID, e.g. cn-huhehaote-a
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

        public ClusterState()
        {
        }
        public static new ClusterState Empty => new ClusterState();
    }
}
