ClusterArgs

data class ClusterArgs(val autoRenewPeriod: Output<Int>? = null, val backupRetentionPolicyOnClusterDeletion: Output<String>? = null, val cloneDataPoint: Output<String>? = null, val collectorStatus: Output<String>? = null, val creationCategory: Output<String>? = null, val creationOption: Output<String>? = null, val dbClusterIpArrays: Output<List<ClusterDbClusterIpArrayArgs>>? = null, val dbNodeClass: Output<String>? = null, val dbNodeCount: Output<Int>? = null, val dbType: Output<String>? = null, val dbVersion: Output<String>? = null, val deletionLock: Output<Int>? = null, val description: Output<String>? = null, val encryptNewTables: Output<String>? = null, val gdnId: Output<String>? = null, val imciSwitch: Output<String>? = null, val maintainTime: Output<String>? = null, val modifyType: Output<String>? = null, val parameters: Output<List<ClusterParameterArgs>>? = null, val payType: Output<String>? = null, val period: Output<Int>? = null, val renewalStatus: Output<String>? = null, val resourceGroupId: Output<String>? = null, val securityGroupIds: Output<List<String>>? = null, val securityIps: Output<List<String>>? = null, val sourceResourceId: Output<String>? = null, val subCategory: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val tdeStatus: Output<String>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<ClusterArgs>

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

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.polardb.Cluster;
import com.pulumi.alicloud.polardb.ClusterArgs;
import com.pulumi.alicloud.polardb.inputs.ClusterDbClusterIpArrayArgs;
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("polardbClusterconfig");
final var creation = config.get("creation").orElse("PolarDB");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation(creation)
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName(name)
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.dbType("MySQL")
.dbVersion("5.6")
.dbNodeClass("polar.mysql.x4.medium")
.payType("PostPaid")
.description(name)
.vswitchId(defaultSwitch.id())
.dbClusterIpArrays(
ClusterDbClusterIpArrayArgs.builder()
.dbClusterIpArrayName("default")
.securityIps(
"1.2.3.4",
"1.2.3.5")
.build(),
ClusterDbClusterIpArrayArgs.builder()
.dbClusterIpArrayName("test_ips1")
.securityIps("1.2.3.6")
.build())
.build());
}
}

Import

PolarDB cluster can be imported using the id, e.g.

$ pulumi import alicloud:polardb/cluster:Cluster example pc-abc12345678

Constructors

Link copied to clipboard
fun ClusterArgs(autoRenewPeriod: Output<Int>? = null, backupRetentionPolicyOnClusterDeletion: Output<String>? = null, cloneDataPoint: Output<String>? = null, collectorStatus: Output<String>? = null, creationCategory: Output<String>? = null, creationOption: Output<String>? = null, dbClusterIpArrays: Output<List<ClusterDbClusterIpArrayArgs>>? = null, dbNodeClass: Output<String>? = null, dbNodeCount: Output<Int>? = null, dbType: Output<String>? = null, dbVersion: Output<String>? = null, deletionLock: Output<Int>? = null, description: Output<String>? = null, encryptNewTables: Output<String>? = null, gdnId: Output<String>? = null, imciSwitch: Output<String>? = null, maintainTime: Output<String>? = null, modifyType: Output<String>? = null, parameters: Output<List<ClusterParameterArgs>>? = null, payType: Output<String>? = null, period: Output<Int>? = null, renewalStatus: Output<String>? = null, resourceGroupId: Output<String>? = null, securityGroupIds: Output<List<String>>? = null, securityIps: Output<List<String>>? = null, sourceResourceId: Output<String>? = null, subCategory: Output<String>? = null, tags: Output<Map<String, Any>>? = null, tdeStatus: Output<String>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ClusterArgs

Properties

Link copied to clipboard
val autoRenewPeriod: Output<Int>? = null

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.

Link copied to clipboard

The retention policy for the backup sets when you delete the cluster. Valid values are ALL, LATEST, NONE. Value options can refer to the latest docs DeleteDBCluster

Link copied to clipboard
val cloneDataPoint: Output<String>? = null

The time point of data to be cloned. Valid values are LATEST,BackupID,Timestamp.Value options can refer to the latest docs CreateDBCluster CloneDataPoint.

Link copied to clipboard
val collectorStatus: Output<String>? = null

Specifies whether to enable or disable SQL data collector. Valid values are Enable, Disabled.

Link copied to clipboard
val creationCategory: Output<String>? = null

The edition of the PolarDB service. Valid values are Normal,Basic,ArchiveNormal,NormalMultimaster.Value options can refer to the latest docs CreateDBCluster CreationCategory.

Link copied to clipboard
val creationOption: Output<String>? = null

The method that is used to create a cluster. Valid values are Normal,CloneFromPolarDB,CloneFromRDS,MigrationFromRDS,CreateGdnStandby.Value options can refer to the latest docs CreateDBCluster CreationOption.

Link copied to clipboard

db_cluster_ip_array defines how users can send requests to your API.

Link copied to clipboard
val dbNodeClass: Output<String>? = null

The db_node_class of cluster node.

Link copied to clipboard
val dbNodeCount: Output<Int>? = null

Number of the PolarDB cluster nodes, default is 2(Each cluster must contain at least a primary node and a read-only node). Add/remove nodes by modifying this parameter, valid values: 2~16.

Link copied to clipboard
val dbType: Output<String>? = null

Database type. Value options: MySQL, Oracle, PostgreSQL.

Link copied to clipboard
val dbVersion: Output<String>? = null

Database version. Value options can refer to the latest docs CreateDBCluster DBVersion.

Link copied to clipboard
val deletionLock: Output<Int>? = null

turn on table deletion_lock. Valid values are 0, 1. 1 means to open the cluster protection lock, 0 means to close the cluster protection lock

Link copied to clipboard
val description: Output<String>? = null

The description of cluster.

Link copied to clipboard
val encryptNewTables: Output<String>? = null

turn on table auto encryption. Valid values are ON, OFF. Only MySQL 8.0 supports.

Link copied to clipboard
val gdnId: Output<String>? = null

The ID of the global database network (GDN).

Link copied to clipboard
val imciSwitch: Output<String>? = null

Specifies whether to enable the In-Memory Column Index (IMCI) feature. Valid values are ON, OFF.

Link copied to clipboard
val maintainTime: Output<String>? = null

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

Link copied to clipboard
val modifyType: Output<String>? = null

Use as db_node_class change class, define upgrade or downgrade. Valid values are Upgrade, Downgrade, Default to Upgrade.

Link copied to clipboard
val parameters: Output<List<ClusterParameterArgs>>? = null

Set of parameters needs to be set after DB cluster was launched. Available parameters can refer to the latest docs View database parameter templates .

Link copied to clipboard
val payType: Output<String>? = null

Valid values are PrePaid, PostPaid, Default to PostPaid.

Link copied to clipboard
val period: Output<Int>? = null
Link copied to clipboard
val renewalStatus: Output<String>? = null

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

Link copied to clipboard
val resourceGroupId: Output<String>? = null

The ID of resource group which the PolarDB cluster belongs. If not specified, then it belongs to the default resource group.

Link copied to clipboard
val securityGroupIds: Output<List<String>>? = null

The ID of the security group. Separate multiple security groups with commas (,). You can add a maximum of three security groups to a cluster.

Link copied to clipboard
val securityIps: Output<List<String>>? = null

This attribute has been deprecated from v1.130.0 and using db_cluster_ip_array sub-element security_ips instead. Its value is same as db_cluster_ip_array sub-element security_ips value and its db_cluster_ip_array_name is "default".

Link copied to clipboard
val sourceResourceId: Output<String>? = null

The ID of the source RDS instance or the ID of the source PolarDB cluster. This parameter is required only when CreationOption is set to MigrationFromRDS, CloneFromRDS, or CloneFromPolarDB.Value options can refer to the latest docs CreateDBCluster SourceResourceId.

Link copied to clipboard
val subCategory: Output<String>? = null

The category of the cluster. Valid values are Exclusive, General. Only MySQL supports.

Link copied to clipboard
val tags: Output<Map<String, Any>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val tdeStatus: Output<String>? = null

turn on TDE encryption. Valid values are Enabled, Disabled. Default to Disabled. TDE cannot be closed after it is turned on.

Link copied to clipboard
val vpcId: Output<String>? = null

The id of the VPC.

Link copied to clipboard
val vswitchId: Output<String>? = null

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

Link copied to clipboard
val zoneId: Output<String>? = null

The Zone to launch the DB cluster. it supports multiple zone.