Class Cluster
Provides a PolarDB cluster resource. A PolarDB cluster is an isolated database environment in the cloud. A PolarDB cluster can contain multiple user-created databases.
NOTE: Available in v1.66.0+.
Example Usage
Create a PolarDB MySQL cluster
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "polardbClusterconfig";
var creation = config.Get("creation") ?? "PolarDB";
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.PolarDB.Cluster("defaultCluster", new AliCloud.PolarDB.ClusterArgs
{
DbNodeClass = "rds.mysql.s2.large",
DbType = "MySQL",
DbVersion = "5.6",
Description = name,
PayType = "PostPaid",
VswitchId = defaultSwitch.Id,
});
}
}
Inherited Members
Namespace: Pulumi.AliCloud.PolarDB
Assembly: Pulumi.AliCloud.dll
Syntax
public class Cluster : CustomResource
Constructors
View SourceCluster(String, ClusterArgs, CustomResourceOptions)
Create a Cluster resource with the given unique name, arguments, and options.
Declaration
public Cluster(string name, ClusterArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ClusterArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAutoRenewPeriod
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.
Declaration
public Output<int?> AutoRenewPeriod { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
ConnectionString
(Available in 1.81.0+) PolarDB cluster connection string. When security_ips is configured, the address of cluster type endpoint will be returned, and if only "127.0.0.1" is configured, it will also be an empty string.
Declaration
public Output<string> ConnectionString { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DbNodeClass
The db_node_class of cluster node.
Declaration
public Output<string> DbNodeClass { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DbType
Database type. Value options: MySQL, Oracle, PostgreSQL.
Declaration
public Output<string> DbType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DbVersion
Database version. Value options can refer to the latest docs CreateDBCluster DBVersion.
Declaration
public Output<string> DbVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
The description of cluster.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaintainTime
Maintainable time period format of the instance: HH:MMZ-HH:MMZ (UTC time)
Declaration
public Output<string> MaintainTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ModifyType
Use as db_node_class change class , define upgrade or downgrade. Valid values are Upgrade, Downgrade, Default to Upgrade.
Declaration
public Output<string> ModifyType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Parameters
Set of parameters needs to be set after DB cluster was launched. Available parameters can refer to the latest docs View database parameter templates .
Declaration
public Output<ImmutableArray<ClusterParameter>> Parameters { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<ClusterParameter>> |
PayType
Valid values are PrePaid, PostPaid, Default to PostPaid. Currently, the resource can not supports change pay type.
Declaration
public Output<string> PayType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Period
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.
Declaration
public Output<int?> Period { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
RenewalStatus
Valid values are AutoRenewal, Normal, NotRenewal, Default to NotRenewal.
Declaration
public Output<string> RenewalStatus { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SecurityIps
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]).
Declaration
public Output<ImmutableArray<string>> SecurityIps { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
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.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
VswitchId
The virtual switch ID to launch DB instances in one VPC.
Declaration
public Output<string> VswitchId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ZoneId
The Zone to launch the DB cluster. it supports multiple zone.
Declaration
public Output<string> ZoneId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, ClusterState, CustomResourceOptions)
Get an existing Cluster resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Cluster Get(string name, Input<string> id, ClusterState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ClusterState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Cluster |