Rds Clone Db Instance Args
Provides an RDS Clone DB Instance resource. For information about RDS Clone DB Instance and how to use it, see What is ApsaraDB for RDS.
NOTE: Available since v1.149.0+.
Example Usage
Create an RDS MySQL clone instance
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.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.RdsBackup;
import com.pulumi.alicloud.rds.RdsBackupArgs;
import com.pulumi.alicloud.rds.RdsCloneDbInstance;
import com.pulumi.alicloud.rds.RdsCloneDbInstanceArgs;
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 exampleZones = RdsFunctions.getZones(GetZonesArgs.builder()
.engine("PostgreSQL")
.engineVersion("13.0")
.instanceChargeType("PostPaid")
.category("HighAvailability")
.dbInstanceStorageType("cloud_essd")
.build());
final var exampleInstanceClasses = RdsFunctions.getInstanceClasses(GetInstanceClassesArgs.builder()
.zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.engine("PostgreSQL")
.engineVersion("13.0")
.category("HighAvailability")
.dbInstanceStorageType("cloud_essd")
.instanceChargeType("PostPaid")
.build());
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(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchName("terraform-example")
.build());
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.engine("PostgreSQL")
.engineVersion("13.0")
.instanceType(exampleInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].instanceClass()))
.instanceStorage(exampleInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].storageRange().min()))
.instanceChargeType("Postpaid")
.instanceName("terraform-example")
.vswitchId(exampleSwitch.id())
.monitoringPeriod("60")
.build());
var exampleRdsBackup = new RdsBackup("exampleRdsBackup", RdsBackupArgs.builder()
.dbInstanceId(exampleInstance.id())
.removeFromState("true")
.build());
var exampleRdsCloneDbInstance = new RdsCloneDbInstance("exampleRdsCloneDbInstance", RdsCloneDbInstanceArgs.builder()
.sourceDbInstanceId(exampleInstance.id())
.dbInstanceStorageType("cloud_essd")
.paymentType("PayAsYouGo")
.backupId(exampleRdsBackup.backupId())
.build());
}
}
Import
RDS Clone DB Instance can be imported using the id, e.g.
$ pulumi import alicloud:rds/rdsCloneDbInstance:RdsCloneDbInstance example <id>
Constructors
Functions
Properties
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)
.
The instance type of the new instance. For information, see Primary ApsaraDB RDS instance types.
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.
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.
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)
.
The information about the databases and tables that you want to restore. Format: [{"type":"db","name":"The original name of Database 1","newname":"The new name of Database 1","tables":{"type":"table","name":"The original name of Table 1 in Database 1","newname":"The new name of Table 1 in Database 1"},{"type":"table","name":"The original name of Table 2 in Database 1","newname":"The new name of Table 2 in Database 1"}},{"type":"db","name":"The original name of Database 2","newname":"The new name of Database 2","tables":{"type":"table","name":"The original name of Table 1 in Database 2","newname":"The new name of Table 1 in Database 2"},{"type":"table","name":"The original name of Table 2 in Database 2","newname":"The new name of Table 2 in Database 2"}}]
The ID of the zone to which the new instance belongs. You can call the DescribeRegions operation to query the most recent region list.