BaseInstance

class BaseInstance : KotlinCustomResource

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: [
Promise.all([_default, _default.then(_default => _default.ids).length]).then(([_default, length]) => _default.ids[length - 2]),
Promise.all([_default, _default.then(_default => _default.ids).length]).then(([_default, length]) => _default.ids[length - 3]),
Promise.all([_default, _default.then(_default => _default.ids).length]).then(([_default, length]) => _default.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=[
default.ids[len(default.ids) - 2],
default.ids[len(default.ids) - 3],
default.ids[len(default.ids) - 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{
pulumi.String(_default.Ids[float64(pulumi.Float64(len(_default.Ids))-2)]),
pulumi.String(_default.Ids[float64(pulumi.Float64(len(_default.Ids))-3)]),
pulumi.String(_default.Ids[float64(pulumi.Float64(len(_default.Ids))-4)]),
},
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();
final var defaultGetResourceGroups = ResourcemanagerFunctions.getResourceGroups();
var defaultBaseInstance = new BaseInstance("defaultBaseInstance", BaseInstanceArgs.builder()
.resourceGroupId(defaultGetResourceGroups.applyValue(getResourceGroupsResult -> getResourceGroupsResult.ids()[0]))
.zones(
default_.ids()[default_.ids().length() - 2],
default_.ids()[default_.ids().length() - 3],
default_.ids()[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>

Properties

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

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

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

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

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

Link copied to clipboard
val commodityCode: Output<String>

The product code of the OceanBase cluster._oceanbasepre_public_cn: Domestic station cloud database package Year-to-month package._oceanbasepost_public_cn: The domestic station cloud database is paid by the hour._obpre_public_intl: International Station Cloud Database Package Monthly Package.

Link copied to clipboard
val cpu: Output<Int>

The number of CPU cores of the cluster.

Link copied to clipboard
val cpuArch: Output<String>

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

Link copied to clipboard
val createTime: Output<String>

The creation time of the resource

Link copied to clipboard
val diskSize: Output<Int>

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>

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 id: Output<String>
Link copied to clipboard
val instanceClass: Output<String>

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>

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>

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>

The OceanBase Server version number.

Link copied to clipboard
val paymentType: Output<String>

The payment method of the instance. Value range:

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

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

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

The ID of the primary instance.

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

The primary instance Region.

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 enterprise resource group to which the instance resides.

Link copied to clipboard
val series: Output<String>

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

The status of the resource

Link copied to clipboard

Valid values:

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zones: Output<List<String>>

Information about the zone where the cluster is deployed.