1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ackone
  5. Cluster
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.ackone.Cluster

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    Provides a Ack One Cluster resource. Fleet Manager Cluster.

    For information about Ack One Cluster and how to use it, see What is Cluster.

    NOTE: Available since v1.212.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") || "terraform-example";
    const defaultZones = alicloud.getZones({
        availableResourceCreation: "VSwitch",
    });
    const defaultVpc = new alicloud.vpc.Network("defaultVpc", {
        cidrBlock: "172.16.0.0/12",
        vpcName: name,
    });
    const defaultyVSwitch = new alicloud.vpc.Switch("defaultyVSwitch", {
        vpcId: defaultVpc.id,
        cidrBlock: "172.16.2.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
        vswitchName: name,
    });
    const defaultCluster = new alicloud.ackone.Cluster("defaultCluster", {network: {
        vpcId: defaultVpc.id,
        vswitches: [defaultyVSwitch.id],
    }});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default_zones = alicloud.get_zones(available_resource_creation="VSwitch")
    default_vpc = alicloud.vpc.Network("defaultVpc",
        cidr_block="172.16.0.0/12",
        vpc_name=name)
    defaulty_v_switch = alicloud.vpc.Switch("defaultyVSwitch",
        vpc_id=default_vpc.id,
        cidr_block="172.16.2.0/24",
        zone_id=default_zones.zones[0].id,
        vswitch_name=name)
    default_cluster = alicloud.ackone.Cluster("defaultCluster", network=alicloud.ackone.ClusterNetworkArgs(
        vpc_id=default_vpc.id,
        vswitches=[defaulty_v_switch.id],
    ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ackone"
    	"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 := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultVpc, err := vpc.NewNetwork(ctx, "defaultVpc", &vpc.NetworkArgs{
    			CidrBlock: pulumi.String("172.16.0.0/12"),
    			VpcName:   pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultyVSwitch, err := vpc.NewSwitch(ctx, "defaultyVSwitch", &vpc.SwitchArgs{
    			VpcId:       defaultVpc.ID(),
    			CidrBlock:   pulumi.String("172.16.2.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].Id),
    			VswitchName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ackone.NewCluster(ctx, "defaultCluster", &ackone.ClusterArgs{
    			Network: &ackone.ClusterNetworkArgs{
    				VpcId: defaultVpc.ID(),
    				Vswitches: pulumi.StringArray{
    					defaultyVSwitch.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") ?? "terraform-example";
        var defaultZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultVpc = new AliCloud.Vpc.Network("defaultVpc", new()
        {
            CidrBlock = "172.16.0.0/12",
            VpcName = name,
        });
    
        var defaultyVSwitch = new AliCloud.Vpc.Switch("defaultyVSwitch", new()
        {
            VpcId = defaultVpc.Id,
            CidrBlock = "172.16.2.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VswitchName = name,
        });
    
        var defaultCluster = new AliCloud.AckOne.Cluster("defaultCluster", new()
        {
            Network = new AliCloud.AckOne.Inputs.ClusterNetworkArgs
            {
                VpcId = defaultVpc.Id,
                Vswitches = new[]
                {
                    defaultyVSwitch.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.GetZonesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.ackone.Cluster;
    import com.pulumi.alicloud.ackone.ClusterArgs;
    import com.pulumi.alicloud.ackone.inputs.ClusterNetworkArgs;
    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("terraform-example");
            final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            var defaultVpc = new Network("defaultVpc", NetworkArgs.builder()        
                .cidrBlock("172.16.0.0/12")
                .vpcName(name)
                .build());
    
            var defaultyVSwitch = new Switch("defaultyVSwitch", SwitchArgs.builder()        
                .vpcId(defaultVpc.id())
                .cidrBlock("172.16.2.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vswitchName(name)
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()        
                .network(ClusterNetworkArgs.builder()
                    .vpcId(defaultVpc.id())
                    .vswitches(defaultyVSwitch.id())
                    .build())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultVpc:
        type: alicloud:vpc:Network
        properties:
          cidrBlock: 172.16.0.0/12
          vpcName: ${name}
      defaultyVSwitch:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultVpc.id}
          cidrBlock: 172.16.2.0/24
          zoneId: ${defaultZones.zones[0].id}
          vswitchName: ${name}
      defaultCluster:
        type: alicloud:ackone:Cluster
        properties:
          network:
            vpcId: ${defaultVpc.id}
            vswitches:
              - ${defaultyVSwitch.id}
    variables:
      defaultZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableResourceCreation: VSwitch
    

    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,
                network: Optional[ClusterNetworkArgs] = None,
                cluster_name: Optional[str] = None,
                profile: 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:ackone: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.

    Example

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

    var clusterResource = new AliCloud.AckOne.Cluster("clusterResource", new()
    {
        Network = new AliCloud.AckOne.Inputs.ClusterNetworkArgs
        {
            VpcId = "string",
            Vswitches = new[]
            {
                "string",
            },
            SecurityGroupIds = new[]
            {
                "string",
            },
        },
        ClusterName = "string",
        Profile = "string",
    });
    
    example, err := ackone.NewCluster(ctx, "clusterResource", &ackone.ClusterArgs{
    	Network: &ackone.ClusterNetworkArgs{
    		VpcId: pulumi.String("string"),
    		Vswitches: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		SecurityGroupIds: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	ClusterName: pulumi.String("string"),
    	Profile:     pulumi.String("string"),
    })
    
    var clusterResource = new Cluster("clusterResource", ClusterArgs.builder()        
        .network(ClusterNetworkArgs.builder()
            .vpcId("string")
            .vswitches("string")
            .securityGroupIds("string")
            .build())
        .clusterName("string")
        .profile("string")
        .build());
    
    cluster_resource = alicloud.ackone.Cluster("clusterResource",
        network=alicloud.ackone.ClusterNetworkArgs(
            vpc_id="string",
            vswitches=["string"],
            security_group_ids=["string"],
        ),
        cluster_name="string",
        profile="string")
    
    const clusterResource = new alicloud.ackone.Cluster("clusterResource", {
        network: {
            vpcId: "string",
            vswitches: ["string"],
            securityGroupIds: ["string"],
        },
        clusterName: "string",
        profile: "string",
    });
    
    type: alicloud:ackone:Cluster
    properties:
        clusterName: string
        network:
            securityGroupIds:
                - string
            vpcId: string
            vswitches:
                - string
        profile: 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:

    Network Pulumi.AliCloud.AckOne.Inputs.ClusterNetwork
    Cluster network information. See network below.
    ClusterName string
    Cluster name.
    Profile string
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    Network ClusterNetworkArgs
    Cluster network information. See network below.
    ClusterName string
    Cluster name.
    Profile string
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    network ClusterNetwork
    Cluster network information. See network below.
    clusterName String
    Cluster name.
    profile String
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    network ClusterNetwork
    Cluster network information. See network below.
    clusterName string
    Cluster name.
    profile string
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    network ClusterNetworkArgs
    Cluster network information. See network below.
    cluster_name str
    Cluster name.
    profile str
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    network Property Map
    Cluster network information. See network below.
    clusterName String
    Cluster name.
    profile String
    Cluster attributes. Valid values: 'Default', 'XFlow'.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Cluster resource produces the following output properties:

    CreateTime string
    Cluster creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    CreateTime string
    Cluster creation time.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    createTime String
    Cluster creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.
    createTime string
    Cluster creation time.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource.
    create_time str
    Cluster creation time.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource.
    createTime String
    Cluster creation time.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the 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,
            create_time: Optional[str] = None,
            network: Optional[ClusterNetworkArgs] = None,
            profile: Optional[str] = None,
            status: 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
    Cluster name.
    CreateTime string
    Cluster creation time.
    Network Pulumi.AliCloud.AckOne.Inputs.ClusterNetwork
    Cluster network information. See network below.
    Profile string
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    Status string
    The status of the resource.
    ClusterName string
    Cluster name.
    CreateTime string
    Cluster creation time.
    Network ClusterNetworkArgs
    Cluster network information. See network below.
    Profile string
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    Status string
    The status of the resource.
    clusterName String
    Cluster name.
    createTime String
    Cluster creation time.
    network ClusterNetwork
    Cluster network information. See network below.
    profile String
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    status String
    The status of the resource.
    clusterName string
    Cluster name.
    createTime string
    Cluster creation time.
    network ClusterNetwork
    Cluster network information. See network below.
    profile string
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    status string
    The status of the resource.
    cluster_name str
    Cluster name.
    create_time str
    Cluster creation time.
    network ClusterNetworkArgs
    Cluster network information. See network below.
    profile str
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    status str
    The status of the resource.
    clusterName String
    Cluster name.
    createTime String
    Cluster creation time.
    network Property Map
    Cluster network information. See network below.
    profile String
    Cluster attributes. Valid values: 'Default', 'XFlow'.
    status String
    The status of the resource.

    Supporting Types

    ClusterNetwork, ClusterNetworkArgs

    VpcId string
    VpcId to which the cluster belongs.
    Vswitches List<string>
    Switch to which the cluster belongs.
    SecurityGroupIds List<string>
    Security group to which the cluster belongs.
    VpcId string
    VpcId to which the cluster belongs.
    Vswitches []string
    Switch to which the cluster belongs.
    SecurityGroupIds []string
    Security group to which the cluster belongs.
    vpcId String
    VpcId to which the cluster belongs.
    vswitches List<String>
    Switch to which the cluster belongs.
    securityGroupIds List<String>
    Security group to which the cluster belongs.
    vpcId string
    VpcId to which the cluster belongs.
    vswitches string[]
    Switch to which the cluster belongs.
    securityGroupIds string[]
    Security group to which the cluster belongs.
    vpc_id str
    VpcId to which the cluster belongs.
    vswitches Sequence[str]
    Switch to which the cluster belongs.
    security_group_ids Sequence[str]
    Security group to which the cluster belongs.
    vpcId String
    VpcId to which the cluster belongs.
    vswitches List<String>
    Switch to which the cluster belongs.
    securityGroupIds List<String>
    Security group to which the cluster belongs.

    Import

    Ack One Cluster can be imported using the id, e.g.

    $ pulumi import alicloud:ackone/cluster:Cluster 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.52.1 published on Thursday, Apr 4, 2024 by Pulumi