Cluster

Provides a ADB cluster resource. A ADB cluster is an isolated database environment in the cloud. A ADB cluster can contain multiple user-created databases.

NOTE: Available in v1.71.0+.

Example Usage

Create a ADB MySQL cluster

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "adbClusterconfig";
        var creation = config.Get("creation") ?? "ADB";
        var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
        {
            AvailableResourceCreation = creation,
        }));
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
        {
            CidrBlock = "172.16.0.0/16",
        });
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
        {
            AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
            CidrBlock = "172.16.0.0/24",
            VpcId = defaultNetwork.Id,
        });
        var defaultCluster = new AliCloud.Adb.Cluster("defaultCluster", new AliCloud.Adb.ClusterArgs
        {
            DbClusterCategory = "Cluster",
            DbClusterVersion = "3.0",
            DbNodeClass = "C8",
            DbNodeCount = 2,
            DbNodeStorage = 200,
            Description = name,
            PayType = "PostPaid",
            VswitchId = defaultSwitch.Id,
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "adbClusterconfig"
creation = config.get("creation")
if creation is None:
    creation = "ADB"
default_zones = alicloud.get_zones(available_resource_creation=creation)
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
    availability_zone=default_zones.zones[0]["id"],
    cidr_block="172.16.0.0/24",
    vpc_id=default_network.id)
default_cluster = alicloud.adb.Cluster("defaultCluster",
    db_cluster_category="Cluster",
    db_cluster_version="3.0",
    db_node_class="C8",
    db_node_count=2,
    db_node_storage=200,
    description=name,
    pay_type="PostPaid",
    vswitch_id=default_switch.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "adbClusterconfig";
const creation = config.get("creation") || "ADB";

const defaultZones = pulumi.output(alicloud.getZones({
    availableResourceCreation: creation,
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
    cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    availabilityZone: defaultZones.zones[0].id,
    cidrBlock: "172.16.0.0/24",
    vpcId: defaultNetwork.id,
});
const defaultCluster = new alicloud.adb.Cluster("default", {
    dbClusterCategory: "Cluster",
    dbClusterVersion: "3.0",
    dbNodeClass: "C8",
    dbNodeCount: 2,
    dbNodeStorage: 200,
    description: name,
    payType: "PostPaid",
    vswitchId: defaultSwitch.id,
});

Create a Cluster Resource

new Cluster(name: string, args: ClusterArgs, opts?: CustomResourceOptions);
def Cluster(resource_name, opts=None, auto_renew_period=None, db_cluster_category=None, db_cluster_version=None, db_node_class=None, db_node_count=None, db_node_storage=None, description=None, maintain_time=None, pay_type=None, period=None, renewal_status=None, security_ips=None, tags=None, vswitch_id=None, zone_id=None, __props__=None);
func NewCluster(ctx *Context, name string, args ClusterArgs, opts ...ResourceOption) (*Cluster, error)
public Cluster(string name, ClusterArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

Cluster Resource Properties

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

Inputs

The Cluster resource accepts the following input properties:

DbClusterCategory string

Cluster category. Value options: Basic, Cluster.

DbNodeClass string

The db_node_class of cluster node.

DbNodeCount int

The db_node_count of cluster node.

DbNodeStorage int

The db_node_storage of cluster node.

VswitchId string

The virtual switch ID to launch DB instances in one VPC.

AutoRenewPeriod int

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

DbClusterVersion string

Cluster version. Value options: 3.0, Default to 3.0.

Description string

The description of cluster.

MaintainTime string

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

PayType string

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

Period int

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

RenewalStatus string

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

SecurityIps List<string>

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

Tags Dictionary<string, object>

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

ZoneId string

The Zone to launch the DB cluster.

DbClusterCategory string

Cluster category. Value options: Basic, Cluster.

DbNodeClass string

The db_node_class of cluster node.

DbNodeCount int

The db_node_count of cluster node.

DbNodeStorage int

The db_node_storage of cluster node.

VswitchId string

The virtual switch ID to launch DB instances in one VPC.

AutoRenewPeriod int

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

DbClusterVersion string

Cluster version. Value options: 3.0, Default to 3.0.

Description string

The description of cluster.

MaintainTime string

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

PayType string

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

Period int

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

RenewalStatus string

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

SecurityIps []string

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

Tags map[string]interface{}

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

ZoneId string

The Zone to launch the DB cluster.

dbClusterCategory string

Cluster category. Value options: Basic, Cluster.

dbNodeClass string

The db_node_class of cluster node.

dbNodeCount number

The db_node_count of cluster node.

dbNodeStorage number

The db_node_storage of cluster node.

vswitchId string

The virtual switch ID to launch DB instances in one VPC.

autoRenewPeriod number

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

dbClusterVersion string

Cluster version. Value options: 3.0, Default to 3.0.

description string

The description of cluster.

maintainTime string

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

payType string

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

period number

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

renewalStatus string

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

securityIps string[]

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

tags {[key: string]: any}

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

zoneId string

The Zone to launch the DB cluster.

db_cluster_category str

Cluster category. Value options: Basic, Cluster.

db_node_class str

The db_node_class of cluster node.

db_node_count float

The db_node_count of cluster node.

db_node_storage float

The db_node_storage of cluster node.

vswitch_id str

The virtual switch ID to launch DB instances in one VPC.

auto_renew_period float

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

db_cluster_version str

Cluster version. Value options: 3.0, Default to 3.0.

description str

The description of cluster.

maintain_time str

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

pay_type str

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

period float

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

renewal_status str

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

security_ips List[str]

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

tags Dict[str, Any]

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

zone_id str

The Zone to launch the DB 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 str
The provider-assigned unique ID for this managed resource.

Look up an 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
static get(resource_name, id, opts=None, auto_renew_period=None, db_cluster_category=None, db_cluster_version=None, db_node_class=None, db_node_count=None, db_node_storage=None, description=None, maintain_time=None, pay_type=None, period=None, renewal_status=None, security_ips=None, tags=None, vswitch_id=None, zone_id=None, __props__=None);
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)
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.

The following state arguments are supported:

AutoRenewPeriod int

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

DbClusterCategory string

Cluster category. Value options: Basic, Cluster.

DbClusterVersion string

Cluster version. Value options: 3.0, Default to 3.0.

DbNodeClass string

The db_node_class of cluster node.

DbNodeCount int

The db_node_count of cluster node.

DbNodeStorage int

The db_node_storage of cluster node.

Description string

The description of cluster.

MaintainTime string

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

PayType string

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

Period int

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

RenewalStatus string

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

SecurityIps List<string>

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

Tags Dictionary<string, object>

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

VswitchId string

The virtual switch ID to launch DB instances in one VPC.

ZoneId string

The Zone to launch the DB cluster.

AutoRenewPeriod int

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

DbClusterCategory string

Cluster category. Value options: Basic, Cluster.

DbClusterVersion string

Cluster version. Value options: 3.0, Default to 3.0.

DbNodeClass string

The db_node_class of cluster node.

DbNodeCount int

The db_node_count of cluster node.

DbNodeStorage int

The db_node_storage of cluster node.

Description string

The description of cluster.

MaintainTime string

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

PayType string

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

Period int

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

RenewalStatus string

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

SecurityIps []string

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

Tags map[string]interface{}

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

VswitchId string

The virtual switch ID to launch DB instances in one VPC.

ZoneId string

The Zone to launch the DB cluster.

autoRenewPeriod number

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

dbClusterCategory string

Cluster category. Value options: Basic, Cluster.

dbClusterVersion string

Cluster version. Value options: 3.0, Default to 3.0.

dbNodeClass string

The db_node_class of cluster node.

dbNodeCount number

The db_node_count of cluster node.

dbNodeStorage number

The db_node_storage of cluster node.

description string

The description of cluster.

maintainTime string

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

payType string

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

period number

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

renewalStatus string

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

securityIps string[]

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

tags {[key: string]: any}

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

vswitchId string

The virtual switch ID to launch DB instances in one VPC.

zoneId string

The Zone to launch the DB cluster.

auto_renew_period float

Auto-renewal period of an cluster, in the unit of the month. It is valid when pay_type is PrePaid. Valid value:1, 2, 3, 6, 12, 24, 36, Default to 1.

db_cluster_category str

Cluster category. Value options: Basic, Cluster.

db_cluster_version str

Cluster version. Value options: 3.0, Default to 3.0.

db_node_class str

The db_node_class of cluster node.

db_node_count float

The db_node_count of cluster node.

db_node_storage float

The db_node_storage of cluster node.

description str

The description of cluster.

maintain_time str

Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)

pay_type str

Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.

period float

The duration that you will buy DB cluster (in month). It is valid when pay_type is PrePaid. Valid values: [1~9], 12, 24, 36. Default to 1.

renewal_status str

Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.

security_ips List[str]

List of IP addresses allowed to access all databases of an cluster. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).

tags Dict[str, Any]

A mapping of tags to assign to the resource. - Key: It can be up to 64 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It cannot be a null string. - Value: It can be up to 128 characters in length. It cannot begin with “aliyun”, “acs:“, “http://“, or “https://“. It can be a null string.

vswitch_id str

The virtual switch ID to launch DB instances in one VPC.

zone_id str

The Zone to launch the DB cluster.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.