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, String>>? = 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: Deprecated since v1.214.0. DEPRECATED: This resource has been deprecated from version 1.214.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.mongodb.getZones({});
const defaultGetNetworks = alicloud.vpc.getNetworks({
nameRegex: "default-NODELETING",
});
const defaultGetSwitches = Promise.all([defaultGetNetworks, _default])&#46;then(([defaultGetNetworks, _default]) => alicloud.vpc.getSwitches({
vpcId: defaultGetNetworks.ids?.[0],
zoneId: _default.zones?.[0]?.id,
}));
const defaultGetResourceGroups = alicloud.resourcemanager.getResourceGroups({});
const example = new alicloud.mongodb.ServerlessInstance("example", {
accountPassword: "Abc12345",
dbInstanceDescription: "example_value",
dbInstanceStorage: 5,
storageEngine: "WiredTiger",
capacityUnit: 100,
engine: "MongoDB",
resourceGroupId: defaultGetResourceGroups.then(defaultGetResourceGroups => defaultGetResourceGroups.groups?.[0]?.id),
engineVersion: "4.2",
period: 1,
periodPriceType: "Month",
vpcId: defaultGetNetworks.then(defaultGetNetworks => defaultGetNetworks.ids?.[0]),
zoneId: _default.then(_default => _default.zones?.[0]?.id),
vswitchId: defaultGetSwitches.then(defaultGetSwitches => defaultGetSwitches.ids?.[0]),
tags: {
Created: "MongodbServerlessInstance",
For: "TF",
},
securityIpGroups: [{
securityIpGroupAttribute: "example_value",
securityIpGroupName: "example_value",
securityIpList: "192.168.0.1",
}],
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.mongodb.get_zones()
default_get_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_get_switches = alicloud.vpc.get_switches(vpc_id=default_get_networks.ids[0],
zone_id=default.zones[0].id)
default_get_resource_groups = alicloud.resourcemanager.get_resource_groups()
example = alicloud.mongodb.ServerlessInstance("example",
account_password="Abc12345",
db_instance_description="example_value",
db_instance_storage=5,
storage_engine="WiredTiger",
capacity_unit=100,
engine="MongoDB",
resource_group_id=default_get_resource_groups.groups[0].id,
engine_version="4.2",
period=1,
period_price_type="Month",
vpc_id=default_get_networks.ids[0],
zone_id=default.zones[0].id,
vswitch_id=default_get_switches.ids[0],
tags={
"Created": "MongodbServerlessInstance",
"For": "TF",
},
security_ip_groups=[{
"security_ip_group_attribute": "example_value",
"security_ip_group_name": "example_value",
"security_ip_list": "192.168.0.1",
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.MongoDB.GetZones.Invoke();
var defaultGetNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
{
NameRegex = "default-NODELETING",
});
var defaultGetSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
{
VpcId = defaultGetNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
});
var defaultGetResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke();
var example = new AliCloud.MongoDB.ServerlessInstance("example", new()
{
AccountPassword = "Abc12345",
DbInstanceDescription = "example_value",
DbInstanceStorage = 5,
StorageEngine = "WiredTiger",
CapacityUnit = 100,
Engine = "MongoDB",
ResourceGroupId = defaultGetResourceGroups.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id),
EngineVersion = "4.2",
Period = 1,
PeriodPriceType = "Month",
VpcId = defaultGetNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
VswitchId = defaultGetSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
Tags =
{
{ "Created", "MongodbServerlessInstance" },
{ "For", "TF" },
},
SecurityIpGroups = new[]
{
new AliCloud.MongoDB.Inputs.ServerlessInstanceSecurityIpGroupArgs
{
SecurityIpGroupAttribute = "example_value",
SecurityIpGroupName = "example_value",
SecurityIpList = "192.168.0.1",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"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 {
_default, err := mongodb.GetZones(ctx, &mongodb.GetZonesArgs{}, nil)
if err != nil {
return err
}
defaultGetNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
NameRegex: pulumi.StringRef("default-NODELETING"),
}, nil)
if err != nil {
return err
}
defaultGetSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
VpcId: pulumi.StringRef(defaultGetNetworks.Ids[0]),
ZoneId: pulumi.StringRef(_default.Zones[0].Id),
}, nil)
if err != nil {
return err
}
defaultGetResourceGroups, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
if err != nil {
return err
}
_, err = mongodb.NewServerlessInstance(ctx, "example", &mongodb.ServerlessInstanceArgs{
AccountPassword: pulumi.String("Abc12345"),
DbInstanceDescription: pulumi.String("example_value"),
DbInstanceStorage: pulumi.Int(5),
StorageEngine: pulumi.String("WiredTiger"),
CapacityUnit: pulumi.Int(100),
Engine: pulumi.String("MongoDB"),
ResourceGroupId: pulumi.String(defaultGetResourceGroups.Groups[0].Id),
EngineVersion: pulumi.String("4.2"),
Period: pulumi.Int(1),
PeriodPriceType: pulumi.String("Month"),
VpcId: pulumi.String(defaultGetNetworks.Ids[0]),
ZoneId: pulumi.String(_default.Zones[0].Id),
VswitchId: pulumi.String(defaultGetSwitches.Ids[0]),
Tags: pulumi.StringMap{
"Created": pulumi.String("MongodbServerlessInstance"),
"For": pulumi.String("TF"),
},
SecurityIpGroups: mongodb.ServerlessInstanceSecurityIpGroupArray{
&mongodb.ServerlessInstanceSecurityIpGroupArgs{
SecurityIpGroupAttribute: pulumi.String("example_value"),
SecurityIpGroupName: pulumi.String("example_value"),
SecurityIpList: pulumi.String("192.168.0.1"),
},
},
})
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.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 default = MongodbFunctions.getZones(GetZonesArgs.builder()
.build());
final var defaultGetNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
.nameRegex("default-NODELETING")
.build());
final var defaultGetSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
.vpcId(defaultGetNetworks.ids()[0])
.zoneId(default_.zones()[0].id())
.build());
final var defaultGetResourceGroups = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.build());
var example = new ServerlessInstance("example", ServerlessInstanceArgs.builder()
.accountPassword("Abc12345")
.dbInstanceDescription("example_value")
.dbInstanceStorage(5)
.storageEngine("WiredTiger")
.capacityUnit(100)
.engine("MongoDB")
.resourceGroupId(defaultGetResourceGroups.groups()[0].id())
.engineVersion("4.2")
.period(1)
.periodPriceType("Month")
.vpcId(defaultGetNetworks.ids()[0])
.zoneId(default_.zones()[0].id())
.vswitchId(defaultGetSwitches.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());
}
}
resources:
example:
type: alicloud:mongodb:ServerlessInstance
properties:
accountPassword: Abc12345
dbInstanceDescription: example_value
dbInstanceStorage: 5
storageEngine: WiredTiger
capacityUnit: 100
engine: MongoDB
resourceGroupId: ${defaultGetResourceGroups.groups[0].id}
engineVersion: '4.2'
period: 1
periodPriceType: Month
vpcId: ${defaultGetNetworks.ids[0]}
zoneId: ${default.zones[0].id}
vswitchId: ${defaultGetSwitches.ids[0]}
tags:
Created: MongodbServerlessInstance
For: TF
securityIpGroups:
- securityIpGroupAttribute: example_value
securityIpGroupName: example_value
securityIpList: 192.168.0.1
variables:
default:
fn::invoke:
function: alicloud:mongodb:getZones
arguments: {}
defaultGetNetworks:
fn::invoke:
function: alicloud:vpc:getNetworks
arguments:
nameRegex: default-NODELETING
defaultGetSwitches:
fn::invoke:
function: alicloud:vpc:getSwitches
arguments:
vpcId: ${defaultGetNetworks.ids[0]}
zoneId: ${default.zones[0].id}
defaultGetResourceGroups:
fn::invoke:
function: alicloud:resourcemanager:getResourceGroups
arguments: {}

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
constructor(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, String>>? = null, vpcId: Output<String>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

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, String>>? = 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.

Functions

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