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:
- Db
Cluster stringCategory Cluster category. Value options:
Basic,Cluster.- Db
Node stringClass The db_node_class of cluster node.
- Db
Node intCount The db_node_count of cluster node.
- Db
Node intStorage The db_node_storage of cluster node.
- Vswitch
Id string The virtual switch ID to launch DB instances in one VPC.
- Auto
Renew intPeriod 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 stringVersion Cluster version. Value options:
3.0, Default to3.0.- Description string
The description of cluster.
- Maintain
Time string Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
- Pay
Type string Valid values are
PrePaid,PostPaid, Default toPostPaid. 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.- Renewal
Status string Valid values are
AutoRenewal,Normal,NotRenewal, Default toNotRenewal.- Security
Ips 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]).
- 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.
- Zone
Id string The Zone to launch the DB cluster.
- Db
Cluster stringCategory Cluster category. Value options:
Basic,Cluster.- Db
Node stringClass The db_node_class of cluster node.
- Db
Node intCount The db_node_count of cluster node.
- Db
Node intStorage The db_node_storage of cluster node.
- Vswitch
Id string The virtual switch ID to launch DB instances in one VPC.
- Auto
Renew intPeriod 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 stringVersion Cluster version. Value options:
3.0, Default to3.0.- Description string
The description of cluster.
- Maintain
Time string Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
- Pay
Type string Valid values are
PrePaid,PostPaid, Default toPostPaid. 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.- Renewal
Status string Valid values are
AutoRenewal,Normal,NotRenewal, Default toNotRenewal.- Security
Ips []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]).
- 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.
- Zone
Id string The Zone to launch the DB cluster.
- db
Cluster stringCategory Cluster category. Value options:
Basic,Cluster.- db
Node stringClass The db_node_class of cluster node.
- db
Node numberCount The db_node_count of cluster node.
- db
Node numberStorage The db_node_storage of cluster node.
- vswitch
Id string The virtual switch ID to launch DB instances in one VPC.
- auto
Renew numberPeriod 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 stringVersion Cluster version. Value options:
3.0, Default to3.0.- description string
The description of cluster.
- maintain
Time string Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
- pay
Type string Valid values are
PrePaid,PostPaid, Default toPostPaid. 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.- renewal
Status string Valid values are
AutoRenewal,Normal,NotRenewal, Default toNotRenewal.- security
Ips 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]).
- {[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.
- zone
Id string The Zone to launch the DB cluster.
- db_
cluster_ strcategory Cluster category. Value options:
Basic,Cluster.- db_
node_ strclass The db_node_class of cluster node.
- db_
node_ floatcount The db_node_count of cluster node.
- db_
node_ floatstorage The db_node_storage of cluster node.
- vswitch_
id str The virtual switch ID to launch DB instances in one VPC.
- auto_
renew_ floatperiod 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_ strversion Cluster version. Value options:
3.0, Default to3.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 toPostPaid. 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 toNotRenewal.- 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]).
- 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:
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): Clusterstatic 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:
- Auto
Renew intPeriod 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 stringCategory Cluster category. Value options:
Basic,Cluster.- Db
Cluster stringVersion Cluster version. Value options:
3.0, Default to3.0.- Db
Node stringClass The db_node_class of cluster node.
- Db
Node intCount The db_node_count of cluster node.
- Db
Node intStorage The db_node_storage of cluster node.
- Description string
The description of cluster.
- Maintain
Time string Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
- Pay
Type string Valid values are
PrePaid,PostPaid, Default toPostPaid. 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.- Renewal
Status string Valid values are
AutoRenewal,Normal,NotRenewal, Default toNotRenewal.- Security
Ips 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]).
- 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.
- Vswitch
Id string The virtual switch ID to launch DB instances in one VPC.
- Zone
Id string The Zone to launch the DB cluster.
- Auto
Renew intPeriod 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 stringCategory Cluster category. Value options:
Basic,Cluster.- Db
Cluster stringVersion Cluster version. Value options:
3.0, Default to3.0.- Db
Node stringClass The db_node_class of cluster node.
- Db
Node intCount The db_node_count of cluster node.
- Db
Node intStorage The db_node_storage of cluster node.
- Description string
The description of cluster.
- Maintain
Time string Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
- Pay
Type string Valid values are
PrePaid,PostPaid, Default toPostPaid. 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.- Renewal
Status string Valid values are
AutoRenewal,Normal,NotRenewal, Default toNotRenewal.- Security
Ips []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]).
- 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.
- Vswitch
Id string The virtual switch ID to launch DB instances in one VPC.
- Zone
Id string The Zone to launch the DB cluster.
- auto
Renew numberPeriod 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 stringCategory Cluster category. Value options:
Basic,Cluster.- db
Cluster stringVersion Cluster version. Value options:
3.0, Default to3.0.- db
Node stringClass The db_node_class of cluster node.
- db
Node numberCount The db_node_count of cluster node.
- db
Node numberStorage The db_node_storage of cluster node.
- description string
The description of cluster.
- maintain
Time string Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
- pay
Type string Valid values are
PrePaid,PostPaid, Default toPostPaid. 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.- renewal
Status string Valid values are
AutoRenewal,Normal,NotRenewal, Default toNotRenewal.- security
Ips 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]).
- {[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.
- vswitch
Id string The virtual switch ID to launch DB instances in one VPC.
- zone
Id string The Zone to launch the DB cluster.
- auto_
renew_ floatperiod 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_ strcategory Cluster category. Value options:
Basic,Cluster.- db_
cluster_ strversion Cluster version. Value options:
3.0, Default to3.0.- db_
node_ strclass The db_node_class of cluster node.
- db_
node_ floatcount The db_node_count of cluster node.
- db_
node_ floatstorage 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 toPostPaid. 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 toNotRenewal.- 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]).
- 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
alicloudTerraform Provider.