InstanceArgs

data class InstanceArgs(val accountPassword: Output<String>? = null, val autoRenew: Output<Boolean>? = null, val backupPeriods: Output<List<String>>? = null, val backupTime: Output<String>? = null, val dbInstanceClass: Output<String>? = null, val dbInstanceStorage: Output<Int>? = null, val engineVersion: Output<String>? = null, val hiddenZoneId: Output<String>? = null, val instanceChargeType: Output<String>? = null, val kmsEncryptedPassword: Output<String>? = null, val kmsEncryptionContext: Output<Map<String, Any>>? = null, val maintainEndTime: Output<String>? = null, val maintainStartTime: Output<String>? = null, val name: Output<String>? = null, val networkType: Output<String>? = null, val orderType: Output<String>? = null, val parameters: Output<List<InstanceParameterArgs>>? = null, val period: Output<Int>? = null, val readonlyReplicas: Output<Int>? = null, val replicationFactor: Output<Int>? = null, val resourceGroupId: Output<String>? = null, val secondaryZoneId: Output<String>? = null, val securityGroupId: Output<String>? = null, val securityIpLists: Output<List<String>>? = null, val sslAction: Output<String>? = null, val storageEngine: Output<String>? = null, val storageType: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val tdeStatus: Output<String>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<InstanceArgs>

Provides a MongoDB instance resource supports replica set instances only. the MongoDB provides stable, reliable, and automatic scalable database services. It offers a full range of database solutions, such as disaster recovery, backup, recovery, monitoring, and alarms. You can see detail product introduction here

NOTE: Available since v1.37.0. NOTE: The following regions don't support create Classic network MongoDB instance. `cn-zhangjiakou`,`cn-huhehaote`,`ap-southeast-2`,`ap-southeast-3`,`ap-southeast-5`,`ap-south-1`,`me-east-1`,`ap-northeast-1`,`eu-west-1` NOTE: Create MongoDB instance or change instance type and storage would cost 5~10 minutes. Please make full preparation

Example Usage

Create a Mongodb instance

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mongodb.MongodbFunctions;
import com.pulumi.alicloud.mongodb.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.mongodb.Instance;
import com.pulumi.alicloud.mongodb.InstanceArgs;
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("terraform-example");
final var defaultZones = MongodbFunctions.getZones();
final var index = defaultZones.applyValue(getZonesResult -> getZonesResult.zones()).length() - 1;
final var zoneId = defaultZones.applyValue(getZonesResult -> getZonesResult.zones())[index].id();
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.17.3.0/24")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("172.17.3.0/24")
.vpcId(defaultNetwork.id())
.zoneId(zoneId)
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.engineVersion("4.2")
.dbInstanceClass("dds.mongo.mid")
.dbInstanceStorage(10)
.vswitchId(defaultSwitch.id())
.securityIpLists(
"10.168.1.12",
"100.69.7.112")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
}
}

Module Support

You can use to the existing mongodb module to create a MongoDB instance resource one-click.

Import

MongoDB can be imported using the id, e.g.

$ pulumi import alicloud:mongodb/instance:Instance example dds-bp1291daeda44194

Constructors

Link copied to clipboard
fun InstanceArgs(accountPassword: Output<String>? = null, autoRenew: Output<Boolean>? = null, backupPeriods: Output<List<String>>? = null, backupTime: Output<String>? = null, dbInstanceClass: Output<String>? = null, dbInstanceStorage: Output<Int>? = null, engineVersion: Output<String>? = null, hiddenZoneId: Output<String>? = null, instanceChargeType: Output<String>? = null, kmsEncryptedPassword: Output<String>? = null, kmsEncryptionContext: Output<Map<String, Any>>? = null, maintainEndTime: Output<String>? = null, maintainStartTime: Output<String>? = null, name: Output<String>? = null, networkType: Output<String>? = null, orderType: Output<String>? = null, parameters: Output<List<InstanceParameterArgs>>? = null, period: Output<Int>? = null, readonlyReplicas: Output<Int>? = null, replicationFactor: Output<Int>? = null, resourceGroupId: Output<String>? = null, secondaryZoneId: Output<String>? = null, securityGroupId: Output<String>? = null, securityIpLists: Output<List<String>>? = null, sslAction: Output<String>? = null, storageEngine: Output<String>? = null, storageType: Output<String>? = null, tags: Output<Map<String, Any>>? = null, tdeStatus: Output<String>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Functions

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

Properties

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

Password of the root account. It is a string of 6 to 32 characters and is composed of letters, numbers, and underlines.

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

Auto renew for prepaid, true of false. Default is false.

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

MongoDB Instance backup period. It is required when backup_time was existed. Valid values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. Default to Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday

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

MongoDB instance backup time. It is required when backup_period was existed. In the format of HH:mmZ- HH:mmZ. Time setting interval is one hour. If not set, the system will return a default, like "23:00Z-24:00Z".

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

Instance specification. see Instance specifications.

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

User-defined DB instance storage space.Unit: GB. Value range:

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

Database version. Value options can refer to the latest docs CreateDBInstance EngineVersion.

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

Configure the zone where the hidden node is located to deploy multiple zones. NOTE: This parameter value cannot be the same as zone_id and secondary_zone_id parameter values.

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

Valid values are PrePaid, PostPaid, System default to PostPaid. NOTE: It can be modified from PostPaid to PrePaid after version 1.63.0.

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

An KMS encrypts password used to a instance. If the account_password is filled in, this field will be ignored.

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

An KMS encryption context used to decrypt kms_encrypted_password before creating or updating instance with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.

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

The end time of the operation and maintenance time period of the instance, in the format of HH:mmZ (UTC time).

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

The start time of the operation and maintenance time period of the instance, in the format of HH:mmZ (UTC time).

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

The name of DB instance. It a string of 2 to 256 characters.

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

The network type of the instance. Valid values:Classic or VPC. Default value: Classic.

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

The type of configuration changes performed. Default value: DOWNGRADE. Valid values:

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

Set of parameters needs to be set after mongodb instance was launched. See parameters below.

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

The duration that you will buy DB instance (in month). It is valid when instance_charge_type is PrePaid. Valid values: 1~9, 12, 24, 36. System default to 1.

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

The number of read-only nodes in the replica set instance. Default value: 0. Valid values: 0 to 5.

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

Number of replica set nodes. Valid values: 1, 3, 5, 7

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

The ID of the Resource Group.

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

Configure the available area where the slave node (Secondary node) is located to realize multi-available area deployment. NOTE: This parameter value cannot be the same as zone_id and hidden_zone_id parameter values.

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

The Security Group ID of ECS.

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

List of IP addresses allowed to access all databases of an instance. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is 1,32).

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

Actions performed on SSL functions, Valid values: Open: turn on SSL encryption; Close: turn off SSL encryption; Update: update SSL certificate.

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

Storage engine: WiredTiger or RocksDB. System Default value: WiredTiger.

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

The storage type of the instance. Valid values: cloud_essd1, cloud_essd2, cloud_essd3, local_ssd.

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

A mapping of tags to assign to the resource.

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

The TDE(Transparent Data Encryption) status.

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

The ID of the VPC. NOTE: This parameter is valid only when NetworkType is set to VPC.

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

The virtual switch ID to launch DB instances in one VPC.

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

The Zone to launch the DB instance. it supports multiple zone. If it is a multi-zone and vswitch_id is specified, the vswitch must in one of them. The multiple zone ID can be retrieved by setting multi to "true" in the data source alicloud.getZones.