InstanceArgs

data class InstanceArgs(val instanceName: Output<String>? = null, val name: Output<String>? = null, val remark: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<InstanceArgs>

Provides an ONS instance resource. For more information about how to use it, see RocketMQ Instance Management API.

NOTE: The number of instances in the same region cannot exceed 8. At present, the resource does not support region "mq-internet-access" and "ap-southeast-5". NOTE: Available in 1.51.0+

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const example = new alicloud.rocketmq.Instance("example", {
instanceName: `${name}-${_default.result}`,
remark: name,
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = random.index.Integer("default",
min=10000,
max=99999)
example = alicloud.rocketmq.Instance("example",
instance_name=f"{name}-{default['result']}",
remark=name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var example = new AliCloud.RocketMQ.Instance("example", new()
{
InstanceName = $"{name}-{@default.Result}",
Remark = name,
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rocketmq"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"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 := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
_, err = rocketmq.NewInstance(ctx, "example", &rocketmq.InstanceArgs{
InstanceName: pulumi.Sprintf("%v-%v", name, _default.Result),
Remark: 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.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.rocketmq.Instance;
import com.pulumi.alicloud.rocketmq.InstanceArgs;
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("tf-example");
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var example = new Instance("example", InstanceArgs.builder()
.instanceName(String.format("%s-%s", name,default_.result()))
.remark(name)
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
example:
type: alicloud:rocketmq:Instance
properties:
instanceName: ${name}-${default.result}
remark: ${name}

Import

ONS INSTANCE can be imported using the id, e.g.

$ pulumi import alicloud:rocketmq/instance:Instance instance MQ_INST_1234567890_Baso1234567

Constructors

Link copied to clipboard
constructor(instanceName: Output<String>? = null, name: Output<String>? = null, remark: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

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

Two instances on a single account in the same region cannot have the same name. The length must be 3 to 64 characters. Chinese characters, English letters digits and hyphen are allowed.

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

Replaced by instance_name after version 1.97.0.

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

This attribute is a concise description of instance. The length cannot exceed 128.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Functions

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