RdsUpgradeDbInstance

class RdsUpgradeDbInstance : KotlinCustomResource

Provides a RDS Upgrade DB Instance resource. For information about RDS Upgrade DB Instance and how to use it, see What is ApsaraDB for RDS.

NOTE: Available since v1.153.0+.

Example Usage

Create a RDS PostgreSQL upgrade instance

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.rds.getZones({
engine: "PostgreSQL",
engineVersion: "13.0",
instanceChargeType: "PostPaid",
category: "HighAvailability",
dbInstanceStorageType: "cloud_essd",
});
const exampleGetInstanceClasses = example.then(example => alicloud.rds.getInstanceClasses({
zoneId: example.zones?.[0]?.id,
engine: "PostgreSQL",
engineVersion: "13.0",
category: "HighAvailability",
dbInstanceStorageType: "cloud_essd",
instanceChargeType: "PostPaid",
}));
const exampleGetCrossRegions = alicloud.rds.getCrossRegions({});
const exampleNetwork = new alicloud.vpc.Network("example", {
vpcName: "terraform-example",
cidrBlock: "172.16.0.0/16",
});
const exampleSwitch = new alicloud.vpc.Switch("example", {
vpcId: exampleNetwork.id,
cidrBlock: "172.16.0.0/24",
zoneId: example.then(example => example.zones?.[0]?.id),
vswitchName: "terraform-example",
});
const exampleInstance = new alicloud.rds.Instance("example", {
engine: "PostgreSQL",
engineVersion: "13.0",
dbInstanceStorageType: "cloud_essd",
instanceType: exampleGetInstanceClasses.then(exampleGetInstanceClasses => exampleGetInstanceClasses.instanceClasses?.[0]?.instanceClass),
instanceStorage: exampleGetInstanceClasses.then(exampleGetInstanceClasses => exampleGetInstanceClasses.instanceClasses?.[0]?.storageRange?.min),
instanceChargeType: "Postpaid",
instanceName: "terraform-example",
vswitchId: exampleSwitch.id,
monitoringPeriod: 60,
});
const exampleRdsUpgradeDbInstance = new alicloud.rds.RdsUpgradeDbInstance("example", {
sourceDbInstanceId: exampleInstance.id,
targetMajorVersion: "14.0",
dbInstanceClass: exampleInstance.instanceType,
dbInstanceStorage: exampleInstance.instanceStorage,
dbInstanceStorageType: exampleInstance.dbInstanceStorageType,
instanceNetworkType: "VPC",
collectStatMode: "After",
switchOver: "false",
paymentType: "PayAsYouGo",
dbInstanceDescription: "terraform-example",
vswitchId: exampleSwitch.id,
});
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.rds.get_zones(engine="PostgreSQL",
engine_version="13.0",
instance_charge_type="PostPaid",
category="HighAvailability",
db_instance_storage_type="cloud_essd")
example_get_instance_classes = alicloud.rds.get_instance_classes(zone_id=example.zones[0].id,
engine="PostgreSQL",
engine_version="13.0",
category="HighAvailability",
db_instance_storage_type="cloud_essd",
instance_charge_type="PostPaid")
example_get_cross_regions = alicloud.rds.get_cross_regions()
example_network = alicloud.vpc.Network("example",
vpc_name="terraform-example",
cidr_block="172.16.0.0/16")
example_switch = alicloud.vpc.Switch("example",
vpc_id=example_network.id,
cidr_block="172.16.0.0/24",
zone_id=example.zones[0].id,
vswitch_name="terraform-example")
example_instance = alicloud.rds.Instance("example",
engine="PostgreSQL",
engine_version="13.0",
db_instance_storage_type="cloud_essd",
instance_type=example_get_instance_classes.instance_classes[0].instance_class,
instance_storage=example_get_instance_classes.instance_classes[0].storage_range.min,
instance_charge_type="Postpaid",
instance_name="terraform-example",
vswitch_id=example_switch.id,
monitoring_period=60)
example_rds_upgrade_db_instance = alicloud.rds.RdsUpgradeDbInstance("example",
source_db_instance_id=example_instance.id,
target_major_version="14.0",
db_instance_class=example_instance.instance_type,
db_instance_storage=example_instance.instance_storage,
db_instance_storage_type=example_instance.db_instance_storage_type,
instance_network_type="VPC",
collect_stat_mode="After",
switch_over="false",
payment_type="PayAsYouGo",
db_instance_description="terraform-example",
vswitch_id=example_switch.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Rds.GetZones.Invoke(new()
{
Engine = "PostgreSQL",
EngineVersion = "13.0",
InstanceChargeType = "PostPaid",
Category = "HighAvailability",
DbInstanceStorageType = "cloud_essd",
});
var exampleGetInstanceClasses = AliCloud.Rds.GetInstanceClasses.Invoke(new()
{
ZoneId = example.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
Engine = "PostgreSQL",
EngineVersion = "13.0",
Category = "HighAvailability",
DbInstanceStorageType = "cloud_essd",
InstanceChargeType = "PostPaid",
});
var exampleGetCrossRegions = AliCloud.Rds.GetCrossRegions.Invoke();
var exampleNetwork = new AliCloud.Vpc.Network("example", new()
{
VpcName = "terraform-example",
CidrBlock = "172.16.0.0/16",
});
var exampleSwitch = new AliCloud.Vpc.Switch("example", new()
{
VpcId = exampleNetwork.Id,
CidrBlock = "172.16.0.0/24",
ZoneId = example.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
VswitchName = "terraform-example",
});
var exampleInstance = new AliCloud.Rds.Instance("example", new()
{
Engine = "PostgreSQL",
EngineVersion = "13.0",
DbInstanceStorageType = "cloud_essd",
InstanceType = exampleGetInstanceClasses.Apply(getInstanceClassesResult => getInstanceClassesResult.InstanceClasses[0]?.InstanceClass),
InstanceStorage = exampleGetInstanceClasses.Apply(getInstanceClassesResult => getInstanceClassesResult.InstanceClasses[0]?.StorageRange?.Min),
InstanceChargeType = "Postpaid",
InstanceName = "terraform-example",
VswitchId = exampleSwitch.Id,
MonitoringPeriod = 60,
});
var exampleRdsUpgradeDbInstance = new AliCloud.Rds.RdsUpgradeDbInstance("example", new()
{
SourceDbInstanceId = exampleInstance.Id,
TargetMajorVersion = "14.0",
DbInstanceClass = exampleInstance.InstanceType,
DbInstanceStorage = exampleInstance.InstanceStorage,
DbInstanceStorageType = exampleInstance.DbInstanceStorageType,
InstanceNetworkType = "VPC",
CollectStatMode = "After",
SwitchOver = "false",
PaymentType = "PayAsYouGo",
DbInstanceDescription = "terraform-example",
VswitchId = exampleSwitch.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rds"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := rds.GetZones(ctx, &rds.GetZonesArgs{
Engine: pulumi.StringRef("PostgreSQL"),
EngineVersion: pulumi.StringRef("13.0"),
InstanceChargeType: pulumi.StringRef("PostPaid"),
Category: pulumi.StringRef("HighAvailability"),
DbInstanceStorageType: pulumi.StringRef("cloud_essd"),
}, nil)
if err != nil {
return err
}
exampleGetInstanceClasses, err := rds.GetInstanceClasses(ctx, &rds.GetInstanceClassesArgs{
ZoneId: pulumi.StringRef(example.Zones[0].Id),
Engine: pulumi.StringRef("PostgreSQL"),
EngineVersion: pulumi.StringRef("13.0"),
Category: pulumi.StringRef("HighAvailability"),
DbInstanceStorageType: pulumi.StringRef("cloud_essd"),
InstanceChargeType: pulumi.StringRef("PostPaid"),
}, nil)
if err != nil {
return err
}
_, err = rds.GetCrossRegions(ctx, &rds.GetCrossRegionsArgs{}, nil)
if err != nil {
return err
}
exampleNetwork, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
VpcName: pulumi.String("terraform-example"),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
exampleSwitch, err := vpc.NewSwitch(ctx, "example", &vpc.SwitchArgs{
VpcId: exampleNetwork.ID(),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(example.Zones[0].Id),
VswitchName: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
exampleInstance, err := rds.NewInstance(ctx, "example", &rds.InstanceArgs{
Engine: pulumi.String("PostgreSQL"),
EngineVersion: pulumi.String("13.0"),
DbInstanceStorageType: pulumi.String("cloud_essd"),
InstanceType: pulumi.String(exampleGetInstanceClasses.InstanceClasses[0].InstanceClass),
InstanceStorage: pulumi.String(exampleGetInstanceClasses.InstanceClasses[0].StorageRange.Min),
InstanceChargeType: pulumi.String("Postpaid"),
InstanceName: pulumi.String("terraform-example"),
VswitchId: exampleSwitch.ID(),
MonitoringPeriod: pulumi.Int(60),
})
if err != nil {
return err
}
_, err = rds.NewRdsUpgradeDbInstance(ctx, "example", &rds.RdsUpgradeDbInstanceArgs{
SourceDbInstanceId: exampleInstance.ID(),
TargetMajorVersion: pulumi.String("14.0"),
DbInstanceClass: exampleInstance.InstanceType,
DbInstanceStorage: exampleInstance.InstanceStorage,
DbInstanceStorageType: exampleInstance.DbInstanceStorageType,
InstanceNetworkType: pulumi.String("VPC"),
CollectStatMode: pulumi.String("After"),
SwitchOver: pulumi.String("false"),
PaymentType: pulumi.String("PayAsYouGo"),
DbInstanceDescription: pulumi.String("terraform-example"),
VswitchId: exampleSwitch.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.rds.RdsFunctions;
import com.pulumi.alicloud.rds.inputs.GetZonesArgs;
import com.pulumi.alicloud.rds.inputs.GetInstanceClassesArgs;
import com.pulumi.alicloud.rds.inputs.GetCrossRegionsArgs;
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.rds.Instance;
import com.pulumi.alicloud.rds.InstanceArgs;
import com.pulumi.alicloud.rds.RdsUpgradeDbInstance;
import com.pulumi.alicloud.rds.RdsUpgradeDbInstanceArgs;
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 example = RdsFunctions.getZones(GetZonesArgs.builder()
.engine("PostgreSQL")
.engineVersion("13.0")
.instanceChargeType("PostPaid")
.category("HighAvailability")
.dbInstanceStorageType("cloud_essd")
.build());
final var exampleGetInstanceClasses = RdsFunctions.getInstanceClasses(GetInstanceClassesArgs.builder()
.zoneId(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.engine("PostgreSQL")
.engineVersion("13.0")
.category("HighAvailability")
.dbInstanceStorageType("cloud_essd")
.instanceChargeType("PostPaid")
.build());
final var exampleGetCrossRegions = RdsFunctions.getCrossRegions();
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.16.0.0/16")
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.vpcId(exampleNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName("terraform-example")
.build());
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.engine("PostgreSQL")
.engineVersion("13.0")
.dbInstanceStorageType("cloud_essd")
.instanceType(exampleGetInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].instanceClass()))
.instanceStorage(exampleGetInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].storageRange().min()))
.instanceChargeType("Postpaid")
.instanceName("terraform-example")
.vswitchId(exampleSwitch.id())
.monitoringPeriod("60")
.build());
var exampleRdsUpgradeDbInstance = new RdsUpgradeDbInstance("exampleRdsUpgradeDbInstance", RdsUpgradeDbInstanceArgs.builder()
.sourceDbInstanceId(exampleInstance.id())
.targetMajorVersion("14.0")
.dbInstanceClass(exampleInstance.instanceType())
.dbInstanceStorage(exampleInstance.instanceStorage())
.dbInstanceStorageType(exampleInstance.dbInstanceStorageType())
.instanceNetworkType("VPC")
.collectStatMode("After")
.switchOver("false")
.paymentType("PayAsYouGo")
.dbInstanceDescription("terraform-example")
.vswitchId(exampleSwitch.id())
.build());
}
}
resources:
exampleNetwork:
type: alicloud:vpc:Network
name: example
properties:
vpcName: terraform-example
cidrBlock: 172.16.0.0/16
exampleSwitch:
type: alicloud:vpc:Switch
name: example
properties:
vpcId: ${exampleNetwork.id}
cidrBlock: 172.16.0.0/24
zoneId: ${example.zones[0].id}
vswitchName: terraform-example
exampleInstance:
type: alicloud:rds:Instance
name: example
properties:
engine: PostgreSQL
engineVersion: '13.0'
dbInstanceStorageType: cloud_essd
instanceType: ${exampleGetInstanceClasses.instanceClasses[0].instanceClass}
instanceStorage: ${exampleGetInstanceClasses.instanceClasses[0].storageRange.min}
instanceChargeType: Postpaid
instanceName: terraform-example
vswitchId: ${exampleSwitch.id}
monitoringPeriod: '60'
exampleRdsUpgradeDbInstance:
type: alicloud:rds:RdsUpgradeDbInstance
name: example
properties:
sourceDbInstanceId: ${exampleInstance.id}
targetMajorVersion: '14.0'
dbInstanceClass: ${exampleInstance.instanceType}
dbInstanceStorage: ${exampleInstance.instanceStorage}
dbInstanceStorageType: ${exampleInstance.dbInstanceStorageType}
instanceNetworkType: VPC
collectStatMode: After
switchOver: 'false'
paymentType: PayAsYouGo
dbInstanceDescription: terraform-example
vswitchId: ${exampleSwitch.id}
variables:
example:
fn::invoke:
function: alicloud:rds:getZones
arguments:
engine: PostgreSQL
engineVersion: '13.0'
instanceChargeType: PostPaid
category: HighAvailability
dbInstanceStorageType: cloud_essd
exampleGetInstanceClasses:
fn::invoke:
function: alicloud:rds:getInstanceClasses
arguments:
zoneId: ${example.zones[0].id}
engine: PostgreSQL
engineVersion: '13.0'
category: HighAvailability
dbInstanceStorageType: cloud_essd
instanceChargeType: PostPaid
exampleGetCrossRegions:
fn::invoke:
function: alicloud:rds:getCrossRegions
arguments: {}

Import

RDS Upgrade DB Instance can be imported using the id, e.g.

$ pulumi import alicloud:rds/rdsUpgradeDbInstance:RdsUpgradeDbInstance example <id>

Properties

Link copied to clipboard
val acl: Output<String>

This parameter is only supported by the RDS PostgreSQL cloud disk version. This parameter indicates the authentication method. It is allowed only when the public key of the client certificate authority is enabled. Valid values: cert and perfer and verify-ca and verify-full (supported by RDS PostgreSQL above 12).

Link copied to clipboard

How to upgrade the minor version of the instance. Valid values:

Link copied to clipboard
val caType: Output<String>

This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the certificate type. When the value of ssl_action is Open, the default value of this parameter is aliyun. Value range:

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

The file that contains the certificate used for TDE.

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

This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the public key of the client certification authority. If the value of client_ca_enabled is 1, this parameter must be configured.

Link copied to clipboard
val clientCaEnabled: Output<Int>?

The client ca enabled.

Link copied to clipboard

This parameter is only supported by the RDS PostgreSQL cloud disk version, which indicates that the client revokes the certificate file. If the value of client_crl_enabled is 1, this parameter must be configured.

Link copied to clipboard
val clientCrlEnabled: Output<Int>?

The client crl enabled.

Link copied to clipboard
val collectStatMode: Output<String>

The time at which ApsaraDB RDS collects the statistics of the new instance.

Link copied to clipboard

The database connection address.

Link copied to clipboard

The connection string prefix.

Link copied to clipboard
val dbInstanceClass: Output<String>

The instance type of the new instance. For information, see Primary ApsaraDB RDS instance types.

Link copied to clipboard

The db instance description.

Link copied to clipboard
val dbInstanceStorage: Output<Int>

The storage capacity of the new instance. Unit: GB. The storage capacity increases in increments of 5 GB. For more information, see Primary ApsaraDB RDS instance types.

Link copied to clipboard

The type of storage media that is used for the new instance. Valid values:

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

The name of the database for which you want to enable TDE. Up to 50 names can be entered in a single request. If you specify multiple names, separate these names with commas (,).

Link copied to clipboard

The ID of the dedicated cluster to which the new instance belongs. This parameter takes effect only when you create the new instance in a dedicated cluster.

Link copied to clipboard

The switch of delete protection. Valid values:

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

The direction. Valid values: Auto, Down, TempUpgrade, Up.

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

The effective time.

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

The ID of the private key.

Link copied to clipboard
val engine: Output<String>

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

Link copied to clipboard
val engineVersion: Output<String>

Database version. Value:

Link copied to clipboard
val forceRestart: Output<Boolean>?

Set it to true to make some parameter efficient when modifying them. Default to false.

Link copied to clipboard
val haMode: Output<String>

The high availability mode. Valid values:

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

The network type of the instance. Valid values:

Link copied to clipboard
val maintainTime: Output<String>

The maintainable time period of the instance. Format: HH:mm Z- HH:mm Z(UTC time).

Link copied to clipboard

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

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

The password of the certificate.

Link copied to clipboard
val paymentType: Output<String>

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

Link copied to clipboard

The configuration of AD domain . See pg_hba_conf below.

Link copied to clipboard
val port: Output<String>

The port.

Link copied to clipboard

The intranet IP address of the new instance must be within the specified vSwitch IP address range. By default, the system automatically allocates by using VPCId and VSwitchId.

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

The file that contains the private key used for TDE.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The released keep policy.

Link copied to clipboard
val replicationAcl: Output<String>

This parameter is only supported by the RDS PostgreSQL cloud disk version, indicating the authentication method of the replication permission. It is only allowed when the public key of the client certificate authority is enabled. Valid values: cert and perfer and verify-ca and verify-full (supported by RDS PostgreSQL above 12).

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

The resource group id.

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

The Alibaba Cloud Resource Name (ARN) of a RAM role. A RAM role is a virtual RAM identity that you can create within your Alibaba Cloud account. For more information, see RAM role overview.

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

The IP address whitelist of the instance. Separate multiple IP addresses with commas (,) and cannot be repeated. The following two formats are supported:

Link copied to clipboard
val serverCert: Output<String>

This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the content of the server certificate. If the CAType value is custom, this parameter must be configured.

Link copied to clipboard
val serverKey: Output<String>

This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the private key of the server certificate. If the value of CAType is custom, this parameter must be configured.

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

The source biz.

Link copied to clipboard

The source db instance id.

Link copied to clipboard
val sslEnabled: Output<Int>

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

Link copied to clipboard
val switchOver: Output<String>

Specifies whether ApsaraDB RDS automatically switches your workloads over to the new instance after data is migrated to the new instance. Valid values:

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

The time at which you want to apply the specification changes. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

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

The time at which ApsaraDB RDS switches your workloads over to the new instance. This parameter is used together with the SwitchOver parameter and takes effect only when you set the SwitchOver parameter to true. Valid values:

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

The major engine version of the new instance. The value of this parameter must be the major engine version on which an upgrade check is performed.

Link copied to clipboard

The availability check method of the instance. Valid values:

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

Specifies whether to enable TDE. Valid values: Enabled and Disabled.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vpcId: Output<String>

The ID of the VPC to which the new instance belongs.

Link copied to clipboard
val vswitchId: Output<String>

The ID of the vSwitch associated with the specified VPC.

Link copied to clipboard
val zoneId: Output<String>

The ID of the zone to which the new instance belongs. You can call the DescribeRegions operation to query the most recent region list.

Link copied to clipboard
val zoneIdSlave1: Output<String>

The ID of the zone to which the secondary instance of the new instance belongs. You can specify this parameter only when the original instance runs RDS High-availability Edition. You can select a zone that belongs to the region where the original instance resides. You can call the DescribeRegions operation to query zone IDs.