ServerlessInstanceArgs

data class ServerlessInstanceArgs(val accountPassword: Output<String>? = null, val autoRenew: Output<Boolean>? = null, val capacityUnit: Output<Int>? = null, val dbInstanceDescription: Output<String>? = null, val dbInstanceStorage: Output<Int>? = null, val engine: Output<String>? = null, val engineVersion: Output<String>? = null, val maintainEndTime: Output<String>? = null, val maintainStartTime: Output<String>? = null, val period: Output<Int>? = null, val periodPriceType: Output<String>? = null, val resourceGroupId: Output<String>? = null, val securityIpGroups: Output<List<ServerlessInstanceSecurityIpGroupArgs>>? = null, val storageEngine: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val vpcId: Output<String>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<ServerlessInstanceArgs>

Provides a MongoDB Serverless Instance resource. For information about MongoDB Serverless Instance and how to use it, see What is Serverless Instance.

NOTE: Available in v1.148.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.mongodb.MongodbFunctions;
import com.pulumi.alicloud.mongodb.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.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.mongodb.ServerlessInstance;
import com.pulumi.alicloud.mongodb.ServerlessInstanceArgs;
import com.pulumi.alicloud.mongodb.inputs.ServerlessInstanceSecurityIpGroupArgs;
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 defaultZones = MongodbFunctions.getZones();
final var defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.nameRegex("default-NODELETING")
.build());
final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
.vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
final var defaultResourceGroups = ResourcemanagerFunctions.getResourceGroups();
var example = new ServerlessInstance("example", ServerlessInstanceArgs.builder()
.accountPassword("Abc12345")
.dbInstanceDescription("example_value")
.dbInstanceStorage(5)
.storageEngine("WiredTiger")
.capacityUnit(100)
.engine("MongoDB")
.resourceGroupId(defaultResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.groups()[0].id()))
.engineVersion("4.2")
.period(1)
.periodPriceType("Month")
.vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.vswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
.tags(Map.ofEntries(
Map.entry("Created", "MongodbServerlessInstance"),
Map.entry("For", "TF")
))
.securityIpGroups(ServerlessInstanceSecurityIpGroupArgs.builder()
.securityIpGroupAttribute("example_value")
.securityIpGroupName("example_value")
.securityIpList("192.168.0.1")
.build())
.build());
}
}

Import

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

$ pulumi import alicloud:mongodb/serverlessInstance:ServerlessInstance example <id>

Constructors

Link copied to clipboard
fun ServerlessInstanceArgs(accountPassword: Output<String>? = null, autoRenew: Output<Boolean>? = null, capacityUnit: Output<Int>? = null, dbInstanceDescription: Output<String>? = null, dbInstanceStorage: Output<Int>? = null, engine: Output<String>? = null, engineVersion: Output<String>? = null, maintainEndTime: Output<String>? = null, maintainStartTime: Output<String>? = null, period: Output<Int>? = null, periodPriceType: Output<String>? = null, resourceGroupId: Output<String>? = null, securityIpGroups: Output<List<ServerlessInstanceSecurityIpGroupArgs>>? = null, storageEngine: Output<String>? = null, tags: Output<Map<String, Any>>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Functions

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

Properties

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

The password of the database logon account.

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

Set whether the instance is automatically renewed.

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

The I/O throughput consumed by the instance. Valid values: 100 to 8000.

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

The db instance description.

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

The db instance storage. Valid values: 1 to 100.

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

The database engine of the instance. Valid values: MongoDB.

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

The database version number. Valid values: 4.2.

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

The end time of the maintenance window. Specify the time in the HH:mmZ format. The time must be in UTC. NOTE: The difference between the start time and end time must be one hour. For example, if maintain_start_time is 01:00Z, maintain_end_time must be 02:00Z.

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

The start time of the maintenance window. Specify the time in the HH:mmZ format. The time must be in UTC.

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

The purchase duration of the instance, in months. Valid values: 1 to 9, 12, 24, 36, 60.

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

The period price type. Valid values: Day, Month.

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

The ID of the resource group.

Link copied to clipboard

An array that consists of the information of IP whitelists.

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

The storage engine used by the instance. Valid values: WiredTiger.

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 vpcId: Output<String>? = null

The ID of the VPC network.

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

The of the vswitch.

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

The ID of the zone. Use this parameter to specify the zone created by the instance.