Instance

class Instance : KotlinCustomResource

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

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.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
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 defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups();
final var defaultZones = GpdbFunctions.getZones();
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(defaultZones.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(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
.instanceNetworkType("VPC")
.instanceSpec("2C16G")
.masterNodeNum(1)
.paymentType("PayAsYouGo")
.privateIpAddress("1.1.1.1")
.segStorageType("cloud_essd")
.segNodeNum(4)
.storageSize(50)
.vpcId(defaultNetwork.id())
.vswitchId(defaultSwitch.id())
.ipWhitelists(InstanceIpWhitelistArgs.builder()
.securityIpList("127.0.0.1")
.build())
.build());
}
}

Import

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

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

Properties

Link copied to clipboard

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

Link copied to clipboard

(Available since v1.196.0) The connection string of the instance.

Link copied to clipboard

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

Link copied to clipboard

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

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

The db instance class. see Instance specifications.

Link copied to clipboard
val dbInstanceMode: Output<String>

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

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

The description of the instance.

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

The ID of the encryption key.

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

The encryption type. Valid values: CloudDisk.

Link copied to clipboard
val engine: Output<String>

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>

The version of the database engine used by the instance.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

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>?

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

Link copied to clipboard

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

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

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>

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

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 masterNodeNum: Output<Int>?

The number of Master nodes. Default value: 1. Valid values: 1 to 2. if it is not filled in, the default value is 1 Master node.

Link copied to clipboard
val paymentType: Output<String>

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

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

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 port: Output<String>

(Available since v1.196.0) The connection port of the instance.

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

The private ip address.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGroupId: Output<String>?

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

Link copied to clipboard

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

Link copied to clipboard
val segNodeNum: Output<Int>

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>?

The seg storage type. Valid values: cloud_essd, cloud_efficiency.

Link copied to clipboard
val sslEnabled: Output<Int>

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

Link copied to clipboard
val status: Output<String>

The status of the instance.

Link copied to clipboard
val storageSize: Output<Int>

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

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

A mapping of tags to assign to the resource.

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

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

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

Link copied to clipboard
val vpcId: Output<String>

The vpc ID of the resource.

Link copied to clipboard
val vswitchId: Output<String>

The vswitch id.

Link copied to clipboard
val zoneId: Output<String>

The zone ID of the instance.