InstanceArgs

data class InstanceArgs(val availabilityZone: Output<String>? = null, val createSampleData: Output<Boolean>? = null, val dataShareStatus: Output<String>? = null, val dbInstanceCategory: Output<String>? = null, val dbInstanceClass: Output<String>? = null, val dbInstanceMode: Output<String>? = null, val description: Output<String>? = null, val encryptionKey: Output<String>? = null, val encryptionType: Output<String>? = null, val engine: Output<String>? = null, val engineVersion: Output<String>? = null, val instanceChargeType: Output<String>? = null, val instanceGroupCount: Output<Int>? = null, val instanceNetworkType: Output<String>? = null, val instanceSpec: Output<String>? = null, val ipWhitelists: Output<List<InstanceIpWhitelistArgs>>? = null, val maintainEndTime: Output<String>? = null, val maintainStartTime: Output<String>? = null, val masterCu: Output<Int>? = null, val masterNodeNum: Output<Int>? = null, val parameters: Output<List<InstanceParameterArgs>>? = null, val paymentType: Output<String>? = null, val period: Output<String>? = null, val privateIpAddress: Output<String>? = null, val prodType: Output<String>? = null, val resourceGroupId: Output<String>? = null, val resourceManagementMode: Output<String>? = null, val securityIpLists: Output<List<String>>? = null, val segDiskPerformanceLevel: Output<String>? = null, val segNodeNum: Output<Int>? = null, val segStorageType: Output<String>? = null, val serverlessMode: Output<String>? = null, val sslEnabled: Output<Int>? = null, val storageSize: Output<Int>? = null, val tags: Output<Map<String, String>>? = null, val usedTime: Output<String>? = null, val vectorConfigurationStatus: Output<String>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<InstanceArgs>

Provides a AnalyticDB for PostgreSQL instance resource supports replica set instances only. the AnalyticDB for PostgreSQL provides stable, reliable, and automatic scalable database services. You can see detail product introduction here

NOTE: Available since v1.47.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = alicloud.resourcemanager.getResourceGroups({});
const defaultGetZones = alicloud.gpdb.getZones({});
const defaultGetNetworks = alicloud.vpc.getNetworks({
nameRegex: "^default-NODELETING$",
});
const defaultGetSwitches = Promise.all([defaultGetNetworks, defaultGetZones])&#46;then(([defaultGetNetworks, defaultGetZones]) => alicloud.vpc.getSwitches({
vpcId: defaultGetNetworks.ids?.[0],
zoneId: defaultGetZones.ids?.[0],
}));
const defaultInstance = new alicloud.gpdb.Instance("default", {
dbInstanceCategory: "HighAvailability",
dbInstanceClass: "gpdb.group.segsdx1",
dbInstanceMode: "StorageElastic",
description: name,
engine: "gpdb",
engineVersion: "6.0",
zoneId: defaultGetZones.then(defaultGetZones => defaultGetZones.ids?.[0]),
instanceNetworkType: "VPC",
instanceSpec: "2C16G",
paymentType: "PayAsYouGo",
segStorageType: "cloud_essd",
segNodeNum: 4,
storageSize: 50,
vpcId: defaultGetNetworks.then(defaultGetNetworks => defaultGetNetworks.ids?.[0]),
vswitchId: defaultGetSwitches.then(defaultGetSwitches => defaultGetSwitches.ids?.[0]),
ipWhitelists: [{
securityIpList: "127.0.0.1",
}],
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.resourcemanager.get_resource_groups()
default_get_zones = alicloud.gpdb.get_zones()
default_get_networks = alicloud.vpc.get_networks(name_regex="^default-NODELETING$")
default_get_switches = alicloud.vpc.get_switches(vpc_id=default_get_networks.ids[0],
zone_id=default_get_zones.ids[0])
default_instance = alicloud.gpdb.Instance("default",
db_instance_category="HighAvailability",
db_instance_class="gpdb.group.segsdx1",
db_instance_mode="StorageElastic",
description=name,
engine="gpdb",
engine_version="6.0",
zone_id=default_get_zones.ids[0],
instance_network_type="VPC",
instance_spec="2C16G",
payment_type="PayAsYouGo",
seg_storage_type="cloud_essd",
seg_node_num=4,
storage_size=50,
vpc_id=default_get_networks.ids[0],
vswitch_id=default_get_switches.ids[0],
ip_whitelists=[{
"security_ip_list": "127.0.0.1",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
var defaultGetZones = AliCloud.Gpdb.GetZones.Invoke();
var defaultGetNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
{
NameRegex = "^default-NODELETING$",
});
var defaultGetSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
{
VpcId = defaultGetNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = defaultGetZones.Apply(getZonesResult => getZonesResult.Ids[0]),
});
var defaultInstance = new AliCloud.Gpdb.Instance("default", new()
{
DbInstanceCategory = "HighAvailability",
DbInstanceClass = "gpdb.group.segsdx1",
DbInstanceMode = "StorageElastic",
Description = name,
Engine = "gpdb",
EngineVersion = "6.0",
ZoneId = defaultGetZones.Apply(getZonesResult => getZonesResult.Ids[0]),
InstanceNetworkType = "VPC",
InstanceSpec = "2C16G",
PaymentType = "PayAsYouGo",
SegStorageType = "cloud_essd",
SegNodeNum = 4,
StorageSize = 50,
VpcId = defaultGetNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
VswitchId = defaultGetSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
IpWhitelists = new[]
{
new AliCloud.Gpdb.Inputs.InstanceIpWhitelistArgs
{
SecurityIpList = "127.0.0.1",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gpdb"
"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, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
if err != nil {
return err
}
defaultGetZones, err := gpdb.GetZones(ctx, &gpdb.GetZonesArgs{}, nil)
if err != nil {
return err
}
defaultGetNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
NameRegex: pulumi.StringRef("^default-NODELETING$"),
}, nil)
if err != nil {
return err
}
defaultGetSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
VpcId: pulumi.StringRef(defaultGetNetworks.Ids[0]),
ZoneId: pulumi.StringRef(defaultGetZones.Ids[0]),
}, nil)
if err != nil {
return err
}
_, err = gpdb.NewInstance(ctx, "default", &gpdb.InstanceArgs{
DbInstanceCategory: pulumi.String("HighAvailability"),
DbInstanceClass: pulumi.String("gpdb.group.segsdx1"),
DbInstanceMode: pulumi.String("StorageElastic"),
Description: pulumi.String(name),
Engine: pulumi.String("gpdb"),
EngineVersion: pulumi.String("6.0"),
ZoneId: pulumi.String(defaultGetZones.Ids[0]),
InstanceNetworkType: pulumi.String("VPC"),
InstanceSpec: pulumi.String("2C16G"),
PaymentType: pulumi.String("PayAsYouGo"),
SegStorageType: pulumi.String("cloud_essd"),
SegNodeNum: pulumi.Int(4),
StorageSize: pulumi.Int(50),
VpcId: pulumi.String(defaultGetNetworks.Ids[0]),
VswitchId: pulumi.String(defaultGetSwitches.Ids[0]),
IpWhitelists: gpdb.InstanceIpWhitelistArray{
&gpdb.InstanceIpWhitelistArgs{
SecurityIpList: pulumi.String("127.0.0.1"),
},
},
})
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.gpdb.GpdbFunctions;
import com.pulumi.alicloud.gpdb.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
import com.pulumi.alicloud.gpdb.Instance;
import com.pulumi.alicloud.gpdb.InstanceArgs;
import com.pulumi.alicloud.gpdb.inputs.InstanceIpWhitelistArgs;
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("tf-example");
final var default = ResourcemanagerFunctions.getResourceGroups();
final var defaultGetZones = GpdbFunctions.getZones();
final var defaultGetNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.nameRegex("^default-NODELETING$")
.build());
final var defaultGetSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
.vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.zoneId(defaultGetZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.dbInstanceCategory("HighAvailability")
.dbInstanceClass("gpdb.group.segsdx1")
.dbInstanceMode("StorageElastic")
.description(name)
.engine("gpdb")
.engineVersion("6.0")
.zoneId(defaultGetZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
.instanceNetworkType("VPC")
.instanceSpec("2C16G")
.paymentType("PayAsYouGo")
.segStorageType("cloud_essd")
.segNodeNum(4)
.storageSize(50)
.vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.vswitchId(defaultGetSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
.ipWhitelists(InstanceIpWhitelistArgs.builder()
.securityIpList("127.0.0.1")
.build())
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
defaultInstance:
type: alicloud:gpdb:Instance
name: default
properties:
dbInstanceCategory: HighAvailability
dbInstanceClass: gpdb.group.segsdx1
dbInstanceMode: StorageElastic
description: ${name}
engine: gpdb
engineVersion: '6.0'
zoneId: ${defaultGetZones.ids[0]}
instanceNetworkType: VPC
instanceSpec: 2C16G
paymentType: PayAsYouGo
segStorageType: cloud_essd
segNodeNum: 4
storageSize: 50
vpcId: ${defaultGetNetworks.ids[0]}
vswitchId: ${defaultGetSwitches.ids[0]}
ipWhitelists:
- securityIpList: 127.0.0.1
variables:
default:
fn::invoke:
function: alicloud:resourcemanager:getResourceGroups
arguments: {}
defaultGetZones:
fn::invoke:
function: alicloud:gpdb:getZones
arguments: {}
defaultGetNetworks:
fn::invoke:
function: alicloud:vpc:getNetworks
arguments:
nameRegex: ^default-NODELETING$
defaultGetSwitches:
fn::invoke:
function: alicloud:vpc:getSwitches
arguments:
vpcId: ${defaultGetNetworks.ids[0]}
zoneId: ${defaultGetZones.ids[0]}

Import

AnalyticDB for PostgreSQL can be imported using the id, e.g.

$ pulumi import alicloud:gpdb/instance:Instance example <id>

Constructors

Link copied to clipboard
constructor(availabilityZone: Output<String>? = null, createSampleData: Output<Boolean>? = null, dataShareStatus: Output<String>? = null, dbInstanceCategory: Output<String>? = null, dbInstanceClass: Output<String>? = null, dbInstanceMode: Output<String>? = null, description: Output<String>? = null, encryptionKey: Output<String>? = null, encryptionType: Output<String>? = null, engine: Output<String>? = null, engineVersion: Output<String>? = null, instanceChargeType: Output<String>? = null, instanceGroupCount: Output<Int>? = null, instanceNetworkType: Output<String>? = null, instanceSpec: Output<String>? = null, ipWhitelists: Output<List<InstanceIpWhitelistArgs>>? = null, maintainEndTime: Output<String>? = null, maintainStartTime: Output<String>? = null, masterCu: Output<Int>? = null, masterNodeNum: Output<Int>? = null, parameters: Output<List<InstanceParameterArgs>>? = null, paymentType: Output<String>? = null, period: Output<String>? = null, privateIpAddress: Output<String>? = null, prodType: Output<String>? = null, resourceGroupId: Output<String>? = null, resourceManagementMode: Output<String>? = null, securityIpLists: Output<List<String>>? = null, segDiskPerformanceLevel: Output<String>? = null, segNodeNum: Output<Int>? = null, segStorageType: Output<String>? = null, serverlessMode: Output<String>? = null, sslEnabled: Output<Int>? = null, storageSize: Output<Int>? = null, tags: Output<Map<String, String>>? = null, usedTime: Output<String>? = null, vectorConfigurationStatus: Output<String>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Properties

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

Field availability_zone has been deprecated from provider version 1.187.0. New field zone_id instead.

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

Whether to load the sample dataset after the instance is created. Valid values: true, false.

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

Specifies whether to enable or disable data sharing. Default value: closed. Valid values:

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

The db instance category. Valid values: Basic, HighAvailability.

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

The db instance class. see Instance specifications.

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

The db instance mode. Valid values: StorageElastic, Serverless, Classic.

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

The description of the instance.

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

The ID of the encryption key.

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

The encryption type. Valid values: CloudDisk.

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

The database engine used by the instance. Value options can refer to the latest docs CreateDBInstance EngineVersion.

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

The version of the database engine used by the instance.

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

Field instance_charge_type has been deprecated from provider version 1.187.0. New field payment_type instead.

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

The number of nodes. Valid values: 2, 4, 8, 12, 16, 24, 32, 64, 96, 128.

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

The network type of the instance. Valid values: VPC.

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

The specification of segment nodes.

Link copied to clipboard

The ip whitelist. See ip_whitelist below. Default to creating a whitelist group with the group name "default" and security_ip_list "127.0.0.1".

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

The end time of the maintenance window for the instance. in the format of HH:mmZ (UTC time), for example 03:00Z. start time should be later than end time.

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

The start time of the maintenance window for the instance. in the format of HH:mmZ (UTC time), for example 02:00Z.

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

The amount of coordinator node resources. Valid values: 2, 4, 8, 16, 32.

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

The number of Master nodes. NOTE: Field master_node_num has been deprecated from provider version 1.213.0.

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

The parameters. See parameters below.

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

The billing method of the instance. Valid values: Subscription, PayAsYouGo.

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

The duration that you will buy the resource, in month. required when payment_type is Subscription. Valid values: Year, Month.

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

The private ip address. NOTE: Field private_ip_address has been deprecated from provider version 1.213.0.

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

The type of the product. Default value: standard. Valid values: standard, cost-effective.

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

The ID of the enterprise resource group to which the instance belongs.

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

Resource management mode. Valid values: resourceGroup, resourceQueue.

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

Field security_ip_list has been deprecated from provider version 1.187.0. New field ip_whitelist instead.

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

The ESSD cloud disk performance level. Valid values: pl0, pl1, pl2.

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

Calculate the number of nodes. Valid values: 2 to 512. The value range of the high-availability version of the storage elastic mode is 4 to 512, and the value must be a multiple of 4. The value range of the basic version of the storage elastic mode is 2 to 512, and the value must be a multiple of 2. The-Serverless version has a value range of 2 to 512. The value must be a multiple of 2.

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

The seg storage type. Valid values: cloud_essd. NOTE: If db_instance_mode is set to StorageElastic, seg_storage_type is required. From version 1.233.1, seg_storage_type cannot be modified, or set to cloud_efficiency. seg_storage_type can only be set to cloud_essd.

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

The mode of the Serverless instance. Valid values: Manual, Auto. NOTE: serverless_mode is valid only when db_instance_mode is set to Serverless.

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

Enable or disable SSL. Valid values: 0 and 1.

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

The storage capacity. Unit: GB. Valid values: 50 to 4000.

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

A mapping of tags to assign to the resource.

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

The used time. When the parameter period is Year, the used_time value is 1 to 3. When the parameter period is Month, the used_time value is 1 to 9.

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

Specifies whether to enable vector engine optimization. Default value: disabled. Valid values: enabled and disabled.

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

The vpc ID of the resource.

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

The vswitch id.

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

The zone ID of the instance.

Functions

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