1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. edas
  5. Cluster
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.edas.Cluster

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides an EDAS cluster resource, see What is EDAS Cluster.

    NOTE: Available since v1.82.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const default = alicloud.getRegions({
        current: true,
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultCluster = new alicloud.edas.Cluster("default", {
        clusterName: name,
        clusterType: 2,
        networkMode: 2,
        logicalRegionId: _default.then(_default => _default.regions?.[0]?.id),
        vpcId: defaultNetwork.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.get_regions(current=True)
    default_network = alicloud.vpc.Network("default",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    default_cluster = alicloud.edas.Cluster("default",
        cluster_name=name,
        cluster_type=2,
        network_mode=2,
        logical_region_id=default.regions[0].id,
        vpc_id=default_network.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/edas"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edas.NewCluster(ctx, "default", &edas.ClusterArgs{
    			ClusterName:     pulumi.String(name),
    			ClusterType:     pulumi.Int(2),
    			NetworkMode:     pulumi.Int(2),
    			LogicalRegionId: pulumi.String(_default.Regions[0].Id),
    			VpcId:           defaultNetwork.ID(),
    		})
    		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 config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultCluster = new AliCloud.Edas.Cluster("default", new()
        {
            ClusterName = name,
            ClusterType = 2,
            NetworkMode = 2,
            LogicalRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
            VpcId = defaultNetwork.Id,
        });
    
    });
    
    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.GetRegionsArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.edas.Cluster;
    import com.pulumi.alicloud.edas.ClusterArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
                .current(true)
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
                .clusterName(name)
                .clusterType("2")
                .networkMode("2")
                .logicalRegionId(default_.regions()[0].id())
                .vpcId(defaultNetwork.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: ${name}
          cidrBlock: 10.4.0.0/16
      defaultCluster:
        type: alicloud:edas:Cluster
        name: default
        properties:
          clusterName: ${name}
          clusterType: '2'
          networkMode: '2'
          logicalRegionId: ${default.regions[0].id}
          vpcId: ${defaultNetwork.id}
    variables:
      default:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

    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,
                cluster_name: Optional[str] = None,
                cluster_type: Optional[int] = None,
                network_mode: Optional[int] = None,
                logical_region_id: Optional[str] = None,
                vpc_id: 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:edas: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 exampleclusterResourceResourceFromEdascluster = new AliCloud.Edas.Cluster("exampleclusterResourceResourceFromEdascluster", new()
    {
        ClusterName = "string",
        ClusterType = 0,
        NetworkMode = 0,
        LogicalRegionId = "string",
        VpcId = "string",
    });
    
    example, err := edas.NewCluster(ctx, "exampleclusterResourceResourceFromEdascluster", &edas.ClusterArgs{
    	ClusterName:     pulumi.String("string"),
    	ClusterType:     pulumi.Int(0),
    	NetworkMode:     pulumi.Int(0),
    	LogicalRegionId: pulumi.String("string"),
    	VpcId:           pulumi.String("string"),
    })
    
    var exampleclusterResourceResourceFromEdascluster = new Cluster("exampleclusterResourceResourceFromEdascluster", ClusterArgs.builder()
        .clusterName("string")
        .clusterType(0)
        .networkMode(0)
        .logicalRegionId("string")
        .vpcId("string")
        .build());
    
    examplecluster_resource_resource_from_edascluster = alicloud.edas.Cluster("exampleclusterResourceResourceFromEdascluster",
        cluster_name="string",
        cluster_type=0,
        network_mode=0,
        logical_region_id="string",
        vpc_id="string")
    
    const exampleclusterResourceResourceFromEdascluster = new alicloud.edas.Cluster("exampleclusterResourceResourceFromEdascluster", {
        clusterName: "string",
        clusterType: 0,
        networkMode: 0,
        logicalRegionId: "string",
        vpcId: "string",
    });
    
    type: alicloud:edas:Cluster
    properties:
        clusterName: string
        clusterType: 0
        logicalRegionId: string
        networkMode: 0
        vpcId: 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:

    ClusterName string
    The name of the cluster that you want to create.
    ClusterType int
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    NetworkMode int
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    LogicalRegionId string
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    VpcId string
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    ClusterName string
    The name of the cluster that you want to create.
    ClusterType int
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    NetworkMode int
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    LogicalRegionId string
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    VpcId string
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    clusterName String
    The name of the cluster that you want to create.
    clusterType Integer
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    networkMode Integer
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    logicalRegionId String
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    vpcId String
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    clusterName string
    The name of the cluster that you want to create.
    clusterType number
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    networkMode number
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    logicalRegionId string
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    vpcId string
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    cluster_name str
    The name of the cluster that you want to create.
    cluster_type int
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    network_mode int
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    logical_region_id str
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    vpc_id str
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    clusterName String
    The name of the cluster that you want to create.
    clusterType Number
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    networkMode Number
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    logicalRegionId String
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    vpcId String
    The ID of the Virtual Private Cloud (VPC) for the cluster.

    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,
            cluster_name: Optional[str] = None,
            cluster_type: Optional[int] = None,
            logical_region_id: Optional[str] = None,
            network_mode: Optional[int] = None,
            vpc_id: Optional[str] = None) -> Cluster
    func GetCluster(ctx *Context, name string, id IDInput, state *ClusterState, opts ...ResourceOption) (*Cluster, error)
    public static Cluster Get(string name, Input<string> id, ClusterState? state, CustomResourceOptions? opts = null)
    public static Cluster get(String name, Output<String> id, ClusterState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ClusterName string
    The name of the cluster that you want to create.
    ClusterType int
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    LogicalRegionId string
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    NetworkMode int
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    VpcId string
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    ClusterName string
    The name of the cluster that you want to create.
    ClusterType int
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    LogicalRegionId string
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    NetworkMode int
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    VpcId string
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    clusterName String
    The name of the cluster that you want to create.
    clusterType Integer
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    logicalRegionId String
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    networkMode Integer
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    vpcId String
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    clusterName string
    The name of the cluster that you want to create.
    clusterType number
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    logicalRegionId string
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    networkMode number
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    vpcId string
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    cluster_name str
    The name of the cluster that you want to create.
    cluster_type int
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    logical_region_id str
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    network_mode int
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    vpc_id str
    The ID of the Virtual Private Cloud (VPC) for the cluster.
    clusterName String
    The name of the cluster that you want to create.
    clusterType Number
    The type of the cluster that you want to create. Valid values only: 2: ECS cluster.
    logicalRegionId String
    The ID of the namespace where you want to create the application. You can call the ListUserDefineRegion operation to query the namespace ID.
    networkMode Number
    The network type of the cluster that you want to create. Valid values: 1: classic network. 2: VPC.
    vpcId String
    The ID of the Virtual Private Cloud (VPC) for the cluster.

    Import

    EDAS cluster can be imported using the id, e.g.

    $ pulumi import alicloud:edas/cluster:Cluster cluster cluster_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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi