BaseInstanceArgs

data class BaseInstanceArgs(val autoRenew: Output<Boolean>? = null, val autoRenewPeriod: Output<Int>? = null, val backupRetainMode: Output<String>? = null, val cpuArch: Output<String>? = null, val diskSize: Output<Int>? = null, val diskType: Output<String>? = null, val instanceClass: Output<String>? = null, val instanceName: Output<String>? = null, val nodeNum: Output<String>? = null, val obVersion: Output<String>? = null, val paymentType: Output<String>? = null, val period: Output<Int>? = null, val periodUnit: Output<String>? = null, val primaryInstance: Output<String>? = null, val primaryRegion: Output<String>? = null, val resourceGroupId: Output<String>? = null, val series: Output<String>? = null, val upgradeSpecNative: Output<Boolean>? = null, val zones: Output<List<String>>? = null) : ConvertibleToJava<BaseInstanceArgs>

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

NOTE: Available since v1.203.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = alicloud.getZones({});
const defaultGetResourceGroups = alicloud.resourcemanager.getResourceGroups({});
const defaultBaseInstance = new alicloud.ocean.BaseInstance("default", {
resourceGroupId: defaultGetResourceGroups.then(defaultGetResourceGroups => defaultGetResourceGroups.ids?.[0]),
zones: [
pulumi.all([_default, _default&#46;then(_default => _default&#46;ids)&#46;length])&#46;apply(([_default, length]) => _default&#46;ids[length - 2]),
pulumi.all([_default, _default&#46;then(_default => _default&#46;ids)&#46;length])&#46;apply(([_default, length]) => _default&#46;ids[length - 3]),
pulumi.all([_default, _default&#46;then(_default => _default&#46;ids)&#46;length])&#46;apply(([_default, length]) => _default&#46;ids[length - 4]),
],
autoRenew: false,
diskSize: 100,
paymentType: "PayAsYouGo",
instanceClass: "8C32G",
backupRetainMode: "delete_all",
series: "normal",
instanceName: name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.get_zones()
default_get_resource_groups = alicloud.resourcemanager.get_resource_groups()
default_base_instance = alicloud.ocean.BaseInstance("default",
resource_group_id=default_get_resource_groups.ids[0],
zones=[
len(default.ids).apply(lambda length: default.ids[length - 2]),
len(default.ids).apply(lambda length: default.ids[length - 3]),
len(default.ids).apply(lambda length: default.ids[length - 4]),
],
auto_renew=False,
disk_size=100,
payment_type="PayAsYouGo",
instance_class="8C32G",
backup_retain_mode="delete_all",
series="normal",
instance_name=name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = AliCloud.GetZones.Invoke();
var defaultGetResourceGroups = AliCloud.ResourceManager.GetResourceGroups.Invoke();
var defaultBaseInstance = new AliCloud.Ocean.BaseInstance("default", new()
{
ResourceGroupId = defaultGetResourceGroups.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0]),
Zones = new[]
{
Output.Tuple(@default, @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Ids)).Length).Apply(values =>
{
var @default = values.Item1;
var length = values.Item2;
return @default.Apply(getZonesResult => getZonesResult.Ids)[length - 2];
}),
Output.Tuple(@default, @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Ids)).Length).Apply(values =>
{
var @default = values.Item1;
var length = values.Item2;
return @default.Apply(getZonesResult => getZonesResult.Ids)[length - 3];
}),
Output.Tuple(@default, @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Ids)).Length).Apply(values =>
{
var @default = values.Item1;
var length = values.Item2;
return @default.Apply(getZonesResult => getZonesResult.Ids)[length - 4];
}),
},
AutoRenew = false,
DiskSize = 100,
PaymentType = "PayAsYouGo",
InstanceClass = "8C32G",
BackupRetainMode = "delete_all",
Series = "normal",
InstanceName = name,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ocean"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{}, nil)
if err != nil {
return err
}
defaultGetResourceGroups, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
if err != nil {
return err
}
_, err = ocean.NewBaseInstance(ctx, "default", &ocean.BaseInstanceArgs{
ResourceGroupId: pulumi.String(defaultGetResourceGroups.Ids[0]),
Zones: pulumi.StringArray{
len(_default.Ids).ApplyT(func(length int) (string, error) {
return _default.Ids[length-2], nil
}).(pulumi.StringOutput),
len(_default.Ids).ApplyT(func(length int) (string, error) {
return _default.Ids[length-3], nil
}).(pulumi.StringOutput),
len(_default.Ids).ApplyT(func(length int) (string, error) {
return _default.Ids[length-4], nil
}).(pulumi.StringOutput),
},
AutoRenew: pulumi.Bool(false),
DiskSize: pulumi.Int(100),
PaymentType: pulumi.String("PayAsYouGo"),
InstanceClass: pulumi.String("8C32G"),
BackupRetainMode: pulumi.String("delete_all"),
Series: pulumi.String("normal"),
InstanceName: pulumi.String(name),
})
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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
import com.pulumi.alicloud.ocean.BaseInstance;
import com.pulumi.alicloud.ocean.BaseInstanceArgs;
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 default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.build());
final var defaultGetResourceGroups = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.build());
var defaultBaseInstance = new BaseInstance("defaultBaseInstance", BaseInstanceArgs.builder()
.resourceGroupId(defaultGetResourceGroups.ids()[0])
.zones(
default_.ids().length().applyValue(_length -> default_.ids()[_length - 2]),
default_.ids().length().applyValue(_length -> default_.ids()[_length - 3]),
default_.ids().length().applyValue(_length -> default_.ids()[_length - 4]))
.autoRenew(false)
.diskSize(100)
.paymentType("PayAsYouGo")
.instanceClass("8C32G")
.backupRetainMode("delete_all")
.series("normal")
.instanceName(name)
.build());
}
}

Import

Ocean Base Instance can be imported using the id, e.g.

$ pulumi import alicloud:ocean/baseInstance:BaseInstance example <id>

Constructors

Link copied to clipboard
constructor(autoRenew: Output<Boolean>? = null, autoRenewPeriod: Output<Int>? = null, backupRetainMode: Output<String>? = null, cpuArch: Output<String>? = null, diskSize: Output<Int>? = null, diskType: Output<String>? = null, instanceClass: Output<String>? = null, instanceName: Output<String>? = null, nodeNum: Output<String>? = null, obVersion: Output<String>? = null, paymentType: Output<String>? = null, period: Output<Int>? = null, periodUnit: Output<String>? = null, primaryInstance: Output<String>? = null, primaryRegion: Output<String>? = null, resourceGroupId: Output<String>? = null, series: Output<String>? = null, upgradeSpecNative: Output<Boolean>? = null, zones: Output<List<String>>? = null)

Properties

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

Whether to automatically renew. It takes effect when the parameter ChargeType is PrePaid. Value range:

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

The duration of each auto-renewal. When the value of the AutoRenew parameter is True, this parameter is required.

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

The backup retention policy after the cluster is deleted. The values are as follows:

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

Cpu architecture, x86, arm. If no, the default value is x86

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

The size of the storage space, in GB. The limits of storage space vary according to the cluster specifications, as follows:

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

The storage type of the cluster. Effective only in the standard cluster version (cloud disk). Two types are currently supported:

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

Cluster specification information. Note Please enter the shape as xCxxG, not xCxxGB The x86 cluster architecture currently supports the following packages:

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

OceanBase cluster name. The length is 1 to 20 English or Chinese characters. If this parameter is not specified, the default value is the InstanceId of the cluster.

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

The number of nodes in the cluster. If the deployment mode is n-n-n, the number of nodes is n * 3

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

The OceanBase Server version number.

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

The payment method of the instance. Value range:

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

The duration of the resource purchase. The unit is specified by the PeriodUnit. The parameter InstanceChargeType takes effect only when the value is PrePaid and is required. Once the DedicatedHostId is specified, the value cannot exceed the subscription duration of the dedicated host. When PeriodUnit = Week, Period values: {"1", "2", "3", "4"}. When PeriodUnit = Month, Period values: {"1", "2", "3", "4", "5", "6", "7", "8", "9", "12", "24", "36", "48", "60"}.

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

The duration of the purchase of resources. Package year and Month value range: Month. Default value: Month of the package, which is billed by volume. The default period is Hour.

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

The ID of the primary instance.

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

The primary instance Region.

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

The ID of the enterprise resource group to which the instance resides.

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

Series of OceanBase cluster instances-normal (default): Standard cluster version (cloud disk)-normal_SSD: Standard cluster version (local disk)-history: history Library cluster version.

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

Valid values:

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

Information about the zone where the cluster is deployed.

Functions

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