1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ecs
  5. EcsDedicatedHostCluster
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.ecs.EcsDedicatedHostCluster

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a ECS Dedicated Host Cluster resource.

    For information about ECS Dedicated Host Cluster and how to use it, see What is Dedicated Host Cluster.

    NOTE: Available since v1.146.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const exampleZones = alicloud.getZones({});
    const exampleEcsDedicatedHostCluster = new alicloud.ecs.EcsDedicatedHostCluster("exampleEcsDedicatedHostCluster", {
        dedicatedHostClusterName: "example_value",
        description: "example_value",
        zoneId: exampleZones.then(exampleZones => exampleZones.zones?.[0]?.id),
        tags: {
            Create: "TF",
            For: "DDH_Cluster_Test",
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example_zones = alicloud.get_zones()
    example_ecs_dedicated_host_cluster = alicloud.ecs.EcsDedicatedHostCluster("exampleEcsDedicatedHostCluster",
        dedicated_host_cluster_name="example_value",
        description="example_value",
        zone_id=example_zones.zones[0].id,
        tags={
            "Create": "TF",
            "For": "DDH_Cluster_Test",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleZones, err := alicloud.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecs.NewEcsDedicatedHostCluster(ctx, "exampleEcsDedicatedHostCluster", &ecs.EcsDedicatedHostClusterArgs{
    			DedicatedHostClusterName: pulumi.String("example_value"),
    			Description:              pulumi.String("example_value"),
    			ZoneId:                   pulumi.String(exampleZones.Zones[0].Id),
    			Tags: pulumi.Map{
    				"Create": pulumi.Any("TF"),
    				"For":    pulumi.Any("DDH_Cluster_Test"),
    			},
    		})
    		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 exampleZones = AliCloud.GetZones.Invoke();
    
        var exampleEcsDedicatedHostCluster = new AliCloud.Ecs.EcsDedicatedHostCluster("exampleEcsDedicatedHostCluster", new()
        {
            DedicatedHostClusterName = "example_value",
            Description = "example_value",
            ZoneId = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            Tags = 
            {
                { "Create", "TF" },
                { "For", "DDH_Cluster_Test" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.ecs.EcsDedicatedHostCluster;
    import com.pulumi.alicloud.ecs.EcsDedicatedHostClusterArgs;
    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 exampleZones = AlicloudFunctions.getZones();
    
            var exampleEcsDedicatedHostCluster = new EcsDedicatedHostCluster("exampleEcsDedicatedHostCluster", EcsDedicatedHostClusterArgs.builder()        
                .dedicatedHostClusterName("example_value")
                .description("example_value")
                .zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .tags(Map.ofEntries(
                    Map.entry("Create", "TF"),
                    Map.entry("For", "DDH_Cluster_Test")
                ))
                .build());
    
        }
    }
    
    resources:
      exampleEcsDedicatedHostCluster:
        type: alicloud:ecs:EcsDedicatedHostCluster
        properties:
          dedicatedHostClusterName: example_value
          description: example_value
          zoneId: ${exampleZones.zones[0].id}
          tags:
            Create: TF
            For: DDH_Cluster_Test
    variables:
      exampleZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments: {}
    

    Create EcsDedicatedHostCluster Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new EcsDedicatedHostCluster(name: string, args: EcsDedicatedHostClusterArgs, opts?: CustomResourceOptions);
    @overload
    def EcsDedicatedHostCluster(resource_name: str,
                                args: EcsDedicatedHostClusterArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def EcsDedicatedHostCluster(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                zone_id: Optional[str] = None,
                                dedicated_host_cluster_name: Optional[str] = None,
                                description: Optional[str] = None,
                                dry_run: Optional[bool] = None,
                                tags: Optional[Mapping[str, Any]] = None)
    func NewEcsDedicatedHostCluster(ctx *Context, name string, args EcsDedicatedHostClusterArgs, opts ...ResourceOption) (*EcsDedicatedHostCluster, error)
    public EcsDedicatedHostCluster(string name, EcsDedicatedHostClusterArgs args, CustomResourceOptions? opts = null)
    public EcsDedicatedHostCluster(String name, EcsDedicatedHostClusterArgs args)
    public EcsDedicatedHostCluster(String name, EcsDedicatedHostClusterArgs args, CustomResourceOptions options)
    
    type: alicloud:ecs:EcsDedicatedHostCluster
    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 EcsDedicatedHostClusterArgs
    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 EcsDedicatedHostClusterArgs
    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 EcsDedicatedHostClusterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EcsDedicatedHostClusterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EcsDedicatedHostClusterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var ecsDedicatedHostClusterResource = new AliCloud.Ecs.EcsDedicatedHostCluster("ecsDedicatedHostClusterResource", new()
    {
        ZoneId = "string",
        DedicatedHostClusterName = "string",
        Description = "string",
        DryRun = false,
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := ecs.NewEcsDedicatedHostCluster(ctx, "ecsDedicatedHostClusterResource", &ecs.EcsDedicatedHostClusterArgs{
    	ZoneId:                   pulumi.String("string"),
    	DedicatedHostClusterName: pulumi.String("string"),
    	Description:              pulumi.String("string"),
    	DryRun:                   pulumi.Bool(false),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var ecsDedicatedHostClusterResource = new EcsDedicatedHostCluster("ecsDedicatedHostClusterResource", EcsDedicatedHostClusterArgs.builder()        
        .zoneId("string")
        .dedicatedHostClusterName("string")
        .description("string")
        .dryRun(false)
        .tags(Map.of("string", "any"))
        .build());
    
    ecs_dedicated_host_cluster_resource = alicloud.ecs.EcsDedicatedHostCluster("ecsDedicatedHostClusterResource",
        zone_id="string",
        dedicated_host_cluster_name="string",
        description="string",
        dry_run=False,
        tags={
            "string": "any",
        })
    
    const ecsDedicatedHostClusterResource = new alicloud.ecs.EcsDedicatedHostCluster("ecsDedicatedHostClusterResource", {
        zoneId: "string",
        dedicatedHostClusterName: "string",
        description: "string",
        dryRun: false,
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:ecs:EcsDedicatedHostCluster
    properties:
        dedicatedHostClusterName: string
        description: string
        dryRun: false
        tags:
            string: any
        zoneId: string
    

    EcsDedicatedHostCluster 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 EcsDedicatedHostCluster resource accepts the following input properties:

    ZoneId string
    The ID of the zone in which to create the dedicated host cluster.
    DedicatedHostClusterName string
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    Description string
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    DryRun bool
    The dry run.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    ZoneId string
    The ID of the zone in which to create the dedicated host cluster.
    DedicatedHostClusterName string
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    Description string
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    DryRun bool
    The dry run.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    zoneId String
    The ID of the zone in which to create the dedicated host cluster.
    dedicatedHostClusterName String
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description String
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dryRun Boolean
    The dry run.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    zoneId string
    The ID of the zone in which to create the dedicated host cluster.
    dedicatedHostClusterName string
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description string
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dryRun boolean
    The dry run.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    zone_id str
    The ID of the zone in which to create the dedicated host cluster.
    dedicated_host_cluster_name str
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description str
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dry_run bool
    The dry run.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    zoneId String
    The ID of the zone in which to create the dedicated host cluster.
    dedicatedHostClusterName String
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description String
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dryRun Boolean
    The dry run.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EcsDedicatedHostCluster 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 EcsDedicatedHostCluster Resource

    Get an existing EcsDedicatedHostCluster 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?: EcsDedicatedHostClusterState, opts?: CustomResourceOptions): EcsDedicatedHostCluster
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dedicated_host_cluster_name: Optional[str] = None,
            description: Optional[str] = None,
            dry_run: Optional[bool] = None,
            tags: Optional[Mapping[str, Any]] = None,
            zone_id: Optional[str] = None) -> EcsDedicatedHostCluster
    func GetEcsDedicatedHostCluster(ctx *Context, name string, id IDInput, state *EcsDedicatedHostClusterState, opts ...ResourceOption) (*EcsDedicatedHostCluster, error)
    public static EcsDedicatedHostCluster Get(string name, Input<string> id, EcsDedicatedHostClusterState? state, CustomResourceOptions? opts = null)
    public static EcsDedicatedHostCluster get(String name, Output<String> id, EcsDedicatedHostClusterState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DedicatedHostClusterName string
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    Description string
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    DryRun bool
    The dry run.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    ZoneId string
    The ID of the zone in which to create the dedicated host cluster.
    DedicatedHostClusterName string
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    Description string
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    DryRun bool
    The dry run.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    ZoneId string
    The ID of the zone in which to create the dedicated host cluster.
    dedicatedHostClusterName String
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description String
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dryRun Boolean
    The dry run.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    zoneId String
    The ID of the zone in which to create the dedicated host cluster.
    dedicatedHostClusterName string
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description string
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dryRun boolean
    The dry run.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    zoneId string
    The ID of the zone in which to create the dedicated host cluster.
    dedicated_host_cluster_name str
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description str
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dry_run bool
    The dry run.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    zone_id str
    The ID of the zone in which to create the dedicated host cluster.
    dedicatedHostClusterName String
    The name of the dedicated host cluster. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. It cannot contain http:// or https://.
    description String
    The description of the dedicated host cluster. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
    dryRun Boolean
    The dry run.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    zoneId String
    The ID of the zone in which to create the dedicated host cluster.

    Import

    ECS Dedicated Host Cluster can be imported using the id, e.g.

    $ pulumi import alicloud:ecs/ecsDedicatedHostCluster:EcsDedicatedHostCluster example <id>
    

    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.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi