DbClusterArgs

data class DbClusterArgs(val allocatePublicConnection: Output<Boolean>? = null, val category: Output<String>? = null, val coldStorage: Output<String>? = null, val dbClusterAccessWhiteLists: Output<List<DbClusterDbClusterAccessWhiteListArgs>>? = null, val dbClusterClass: Output<String>? = null, val dbClusterDescription: Output<String>? = null, val dbClusterNetworkType: Output<String>? = null, val dbClusterVersion: Output<String>? = null, val dbNodeGroupCount: Output<Int>? = null, val dbNodeStorage: Output<String>? = null, val encryptionKey: Output<String>? = null, val encryptionType: Output<String>? = null, val maintainTime: Output<String>? = null, val multiZoneVswitchLists: Output<List<DbClusterMultiZoneVswitchListArgs>>? = null, val paymentType: Output<String>? = null, val period: Output<String>? = null, val renewalStatus: Output<String>? = null, val resourceGroupId: Output<String>? = null, val status: Output<String>? = null, val storageType: Output<String>? = null, val usedTime: Output<String>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<DbClusterArgs>

Provides a Click House DBCluster resource. For information about Click House DBCluster and how to use it, see What is DBCluster.

NOTE: Available since v1.134.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const region = config.get("region") || "cn-hangzhou";
const name = config.get("name") || "tf-example";
const _default = alicloud.resourcemanager.getResourceGroups({});
const defaultGetRegions = alicloud.clickhouse.getRegions({
regionId: region,
});
const defaultNetwork = new alicloud.vpc.Network("default", {
vpcName: name,
cidrBlock: "10.4.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
vswitchName: name,
cidrBlock: "10.4.0.0/24",
vpcId: defaultNetwork.id,
zoneId: defaultGetRegions.then(defaultGetRegions => defaultGetRegions.regions?.[0]?&#46;zoneIds?&#46;[0]?.zoneId),
});
const defaultDbCluster = new alicloud.clickhouse.DbCluster("default", {
dbClusterVersion: "23.8",
category: "Basic",
dbClusterClass: "S8",
dbClusterNetworkType: "vpc",
dbNodeGroupCount: 1,
paymentType: "PayAsYouGo",
dbNodeStorage: "100",
storageType: "cloud_essd",
vswitchId: defaultSwitch.id,
vpcId: defaultNetwork.id,
resourceGroupId: _default.then(_default => _default.groups?.[0]?.id),
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
region = config.get("region")
if region is None:
region = "cn-hangzhou"
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.resourcemanager.get_resource_groups()
default_get_regions = alicloud.clickhouse.get_regions(region_id=region)
default_network = alicloud.vpc.Network("default",
vpc_name=name,
cidr_block="10.4.0.0/16")
default_switch = alicloud.vpc.Switch("default",
vswitch_name=name,
cidr_block="10.4.0.0/24",
vpc_id=default_network.id,
zone_id=default_get_regions.regions[0]&#46;zone_ids[0].zone_id)
default_db_cluster = alicloud.clickhouse.DbCluster("default",
db_cluster_version="23.8",
category="Basic",
db_cluster_class="S8",
db_cluster_network_type="vpc",
db_node_group_count=1,
payment_type="PayAsYouGo",
db_node_storage="100",
storage_type="cloud_essd",
vswitch_id=default_switch.id,
vpc_id=default_network.id,
resource_group_id=default.groups[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var region = config.Get("region") ?? "cn-hangzhou";
var name = config.Get("name") ?? "tf-example";
var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
var defaultGetRegions = AliCloud.ClickHouse.GetRegions.Invoke(new()
{
RegionId = region,
});
var defaultNetwork = new AliCloud.Vpc.Network("default", new()
{
VpcName = name,
CidrBlock = "10.4.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
{
VswitchName = name,
CidrBlock = "10.4.0.0/24",
VpcId = defaultNetwork.Id,
ZoneId = defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?&#46;ZoneIds[0]?.ZoneId),
});
var defaultDbCluster = new AliCloud.ClickHouse.DbCluster("default", new()
{
DbClusterVersion = "23.8",
Category = "Basic",
DbClusterClass = "S8",
DbClusterNetworkType = "vpc",
DbNodeGroupCount = 1,
PaymentType = "PayAsYouGo",
DbNodeStorage = "100",
StorageType = "cloud_essd",
VswitchId = defaultSwitch.Id,
VpcId = defaultNetwork.Id,
ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id)),
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/clickhouse"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"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, "")
region := "cn-hangzhou"
if param := cfg.Get("region"); param != "" {
region = param
}
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
if err != nil {
return err
}
defaultGetRegions, err := clickhouse.GetRegions(ctx, &clickhouse.GetRegionsArgs{
RegionId: pulumi.StringRef(region),
}, nil)
if err != nil {
return err
}
defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
CidrBlock: pulumi.String("10.4.0.0/16"),
})
if err != nil {
return err
}
defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
VswitchName: pulumi.String(name),
CidrBlock: pulumi.String("10.4.0.0/24"),
VpcId: defaultNetwork.ID(),
ZoneId: pulumi.String(defaultGetRegions.Regions[0]&#46;ZoneIds[0].ZoneId),
})
if err != nil {
return err
}
_, err = clickhouse.NewDbCluster(ctx, "default", &clickhouse.DbClusterArgs{
DbClusterVersion: pulumi.String("23.8"),
Category: pulumi.String("Basic"),
DbClusterClass: pulumi.String("S8"),
DbClusterNetworkType: pulumi.String("vpc"),
DbNodeGroupCount: pulumi.Int(1),
PaymentType: pulumi.String("PayAsYouGo"),
DbNodeStorage: pulumi.String("100"),
StorageType: pulumi.String("cloud_essd"),
VswitchId: defaultSwitch.ID(),
VpcId: defaultNetwork.ID(),
ResourceGroupId: pulumi.String(_default.Groups[0].Id),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.clickhouse.ClickhouseFunctions;
import com.pulumi.alicloud.clickhouse.inputs.GetRegionsArgs;
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.clickhouse.DbCluster;
import com.pulumi.alicloud.clickhouse.DbClusterArgs;
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 region = config.get("region").orElse("cn-hangzhou");
final var name = config.get("name").orElse("tf-example");
final var default = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.build());
final var defaultGetRegions = ClickhouseFunctions.getRegions(GetRegionsArgs.builder()
.regionId(region)
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.4.0.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultGetRegions.regions()[0]&#46;zoneIds()[0].zoneId())
.build());
var defaultDbCluster = new DbCluster("defaultDbCluster", DbClusterArgs.builder()
.dbClusterVersion("23.8")
.category("Basic")
.dbClusterClass("S8")
.dbClusterNetworkType("vpc")
.dbNodeGroupCount(1)
.paymentType("PayAsYouGo")
.dbNodeStorage("100")
.storageType("cloud_essd")
.vswitchId(defaultSwitch.id())
.vpcId(defaultNetwork.id())
.resourceGroupId(default_.groups()[0].id())
.build());
}
}
configuration:
region:
type: string
default: cn-hangzhou
name:
type: string
default: tf-example
resources:
defaultNetwork:
type: alicloud:vpc:Network
name: default
properties:
vpcName: ${name}
cidrBlock: 10.4.0.0/16
defaultSwitch:
type: alicloud:vpc:Switch
name: default
properties:
vswitchName: ${name}
cidrBlock: 10.4.0.0/24
vpcId: ${defaultNetwork.id}
zoneId: ${defaultGetRegions.regions[0]&#46;zoneIds[0].zoneId}
defaultDbCluster:
type: alicloud:clickhouse:DbCluster
name: default
properties:
dbClusterVersion: '23.8'
category: Basic
dbClusterClass: S8
dbClusterNetworkType: vpc
dbNodeGroupCount: '1'
paymentType: PayAsYouGo
dbNodeStorage: '100'
storageType: cloud_essd
vswitchId: ${defaultSwitch.id}
vpcId: ${defaultNetwork.id}
resourceGroupId: ${default.groups[0].id}
variables:
default:
fn::invoke:
function: alicloud:resourcemanager:getResourceGroups
arguments: {}
defaultGetRegions:
fn::invoke:
function: alicloud:clickhouse:getRegions
arguments:
regionId: ${region}

Import

Click House DBCluster can be imported using the id, e.g.

$ pulumi import alicloud:clickhouse/dbCluster:DbCluster example <id>

Constructors

Link copied to clipboard
constructor(allocatePublicConnection: Output<Boolean>? = null, category: Output<String>? = null, coldStorage: Output<String>? = null, dbClusterAccessWhiteLists: Output<List<DbClusterDbClusterAccessWhiteListArgs>>? = null, dbClusterClass: Output<String>? = null, dbClusterDescription: Output<String>? = null, dbClusterNetworkType: Output<String>? = null, dbClusterVersion: Output<String>? = null, dbNodeGroupCount: Output<Int>? = null, dbNodeStorage: Output<String>? = null, encryptionKey: Output<String>? = null, encryptionType: Output<String>? = null, maintainTime: Output<String>? = null, multiZoneVswitchLists: Output<List<DbClusterMultiZoneVswitchListArgs>>? = null, paymentType: Output<String>? = null, period: Output<String>? = null, renewalStatus: Output<String>? = null, resourceGroupId: Output<String>? = null, status: Output<String>? = null, storageType: Output<String>? = null, usedTime: Output<String>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Properties

Link copied to clipboard
val allocatePublicConnection: Output<Boolean>? = null

Whether to enable public connection. Value options: true, false.

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

The Category of DBCluster. Valid values: Basic,HighAvailability.

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

Whether to use cold storage. Valid values: ENABLE, DISABLE, default to DISABLE. When it's set to ENABLE, cold storage will be used, and cold_storage cannot be set to DISABLE again.

Link copied to clipboard

The db cluster access white list. See db_cluster_access_white_list below.

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

The DBCluster class. According to the category, db_cluster_class has two value ranges:

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

The DBCluster description.

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

The DBCluster network type. Valid values: vpc.

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

The DBCluster version. Valid values: 20.3.10.75, 20.8.7.15, 21.8.10.19, 22.8.5.29, 23.8. NOTE: 19.15.2.2 is no longer supported. From version 1.191.0, db_cluster_version can be set to 22.8.5.29.

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

The db node group count. The number should between 1 and 48.

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

The db node storage.

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

Key management service KMS key ID. It is valid and required when encryption_type is CloudDisk.

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

Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.

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

The maintenance window of DBCluster. Valid format: hh:mmZ-hh:mm Z.

Link copied to clipboard

The zone IDs and corresponding vswitch IDs and zone IDs of multi-zone setup. if set, a multi-zone DBCluster will be created. Currently only support 2 available zones, primary zone not included. See multi_zone_vswitch_list below.

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

The payment type of the resource. Valid values: PayAsYouGo,Subscription.

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

Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when payment_type is Subscription. Valid values: Month, Year.

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

The renewal status of the resource. Valid values: AutoRenewal,Normal. It is valid and required when payment_type is Subscription. When renewal_status is set to AutoRenewal, the resource is renewed automatically.

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

The ID of the resource group.

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

The status of the resource. Valid values: Running,Creating,Deleting,Restarting,Preparing.

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

Storage type of DBCluster. Valid values: cloud_essd, cloud_efficiency, cloud_essd_pl2, cloud_essd_pl3.

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

The used time of DBCluster. It is valid and required when payment_type is Subscription. item choices: 1-9 when period is Month, 1-3 when period is Year.

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

The id of the VPC.

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

The vswitch id of DBCluster.

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

The zone ID of the instance.

Functions

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