1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. edas
  5. Cluster
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.edas.Cluster

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 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 defaultRegions = alicloud.getRegions({
        current: true,
    });
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const defaultCluster = new alicloud.edas.Cluster("defaultCluster", {
        clusterName: name,
        clusterType: 2,
        networkMode: 2,
        logicalRegionId: defaultRegions.then(defaultRegions => defaultRegions.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_regions = alicloud.get_regions(current=True)
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    default_cluster = alicloud.edas.Cluster("defaultCluster",
        cluster_name=name,
        cluster_type=2,
        network_mode=2,
        logical_region_id=default_regions.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
    		}
    		defaultRegions, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
    			Current: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = edas.NewCluster(ctx, "defaultCluster", &edas.ClusterArgs{
    			ClusterName:     pulumi.String(name),
    			ClusterType:     pulumi.Int(2),
    			NetworkMode:     pulumi.Int(2),
    			LogicalRegionId: pulumi.String(defaultRegions.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 defaultRegions = AliCloud.GetRegions.Invoke(new()
        {
            Current = true,
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultCluster = new AliCloud.Edas.Cluster("defaultCluster", new()
        {
            ClusterName = name,
            ClusterType = 2,
            NetworkMode = 2,
            LogicalRegionId = defaultRegions.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 defaultRegions = 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(defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()))
                .vpcId(defaultNetwork.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 10.4.0.0/16
      defaultCluster:
        type: alicloud:edas:Cluster
        properties:
          clusterName: ${name}
          clusterType: '2'
          networkMode: '2'
          logicalRegionId: ${defaultRegions.regions[0].id}
          vpcId: ${defaultNetwork.id}
    variables:
      defaultRegions:
        fn::invoke:
          Function: alicloud:getRegions
          Arguments:
            current: true
    

    Create Cluster Resource

    new Cluster(name: string, args: ClusterArgs, opts?: CustomResourceOptions);
    @overload
    def Cluster(resource_name: 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)
    @overload
    def Cluster(resource_name: str,
                args: ClusterArgs,
                opts: Optional[ResourceOptions] = None)
    func NewCluster(ctx *Context, name string, args ClusterArgs, opts ...ResourceOption) (*Cluster, error)
    public Cluster(string name, ClusterArgs args, CustomResourceOptions? opts = null)
    public Cluster(String name, ClusterArgs args)
    public Cluster(String name, ClusterArgs args, CustomResourceOptions options)
    
    type: alicloud:edas:Cluster
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ClusterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ClusterArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ClusterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Cluster Resource Properties

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

    Inputs

    The Cluster resource accepts the following input properties:

    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
    

    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.51.0 published on Saturday, Mar 23, 2024 by Pulumi