ServerlessInstance

class ServerlessInstance : KotlinCustomResource

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>

Properties

Link copied to clipboard
val accountPassword: Output<String>

The password of the database logon account.

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

Set whether the instance is automatically renewed.

Link copied to clipboard
val capacityUnit: Output<Int>

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

Link copied to clipboard

The db instance description.

Link copied to clipboard
val dbInstanceStorage: Output<Int>

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

Link copied to clipboard
val engine: Output<String>

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

Link copied to clipboard
val engineVersion: Output<String>

The database version number. Valid values: 4.2.

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

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

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

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

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

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 resource group.

Link copied to clipboard

An array that consists of the information of IP whitelists.

Link copied to clipboard
val status: Output<String>

The instance status. For more information, see the instance Status Table.

Link copied to clipboard
val storageEngine: Output<String>

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

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

The ID of the VPC network.

Link copied to clipboard
val vswitchId: Output<String>

The of the vswitch.

Link copied to clipboard
val zoneId: Output<String>

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