Topic

Provides an ONS topic resource.

For more information about how to use it, see RocketMQ Topic Management API.

NOTE: Available in 1.53.0+

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "onsInstanceName";
        var topic = config.Get("topic") ?? "onsTopicName";
        var defaultInstance = new AliCloud.RocketMQ.Instance("defaultInstance", new AliCloud.RocketMQ.InstanceArgs
        {
            Remark = "default_ons_instance_remark",
        });
        var defaultTopic = new AliCloud.RocketMQ.Topic("defaultTopic", new AliCloud.RocketMQ.TopicArgs
        {
            InstanceId = defaultInstance.Id,
            MessageType = 0,
            Remark = "dafault_ons_topic_remark",
            Topic = topic,
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "onsInstanceName"
topic = config.get("topic")
if topic is None:
    topic = "onsTopicName"
default_instance = alicloud.rocketmq.Instance("defaultInstance", remark="default_ons_instance_remark")
default_topic = alicloud.rocketmq.Topic("defaultTopic",
    instance_id=default_instance.id,
    message_type=0,
    remark="dafault_ons_topic_remark",
    topic=topic)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "onsInstanceName";
const topic = config.get("topic") || "onsTopicName";

const defaultInstance = new alicloud.rocketmq.Instance("default", {
    remark: "default_ons_instance_remark",
});
const defaultTopic = new alicloud.rocketmq.Topic("default", {
    instanceId: defaultInstance.id,
    messageType: 0,
    remark: "dafault_ons_topic_remark",
    topic: topic,
});

Create a Topic Resource

new Topic(name: string, args: TopicArgs, opts?: CustomResourceOptions);
def Topic(resource_name, opts=None, instance_id=None, message_type=None, perm=None, remark=None, topic=None, __props__=None);
func NewTopic(ctx *Context, name string, args TopicArgs, opts ...ResourceOption) (*Topic, error)
public Topic(string name, TopicArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TopicArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TopicArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TopicArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Topic Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Topic resource accepts the following input properties:

InstanceId string

ID of the ONS Instance that owns the topics.

MessageType int

The type of the message. Read Ons Topic Create for further details.

TopicName string

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

Perm int

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

Remark string

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

InstanceId string

ID of the ONS Instance that owns the topics.

MessageType int

The type of the message. Read Ons Topic Create for further details.

Topic string

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

Perm int

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

Remark string

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

instanceId string

ID of the ONS Instance that owns the topics.

messageType number

The type of the message. Read Ons Topic Create for further details.

topic string

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

perm number

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

remark string

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

instance_id str

ID of the ONS Instance that owns the topics.

message_type float

The type of the message. Read Ons Topic Create for further details.

topic str

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

perm float

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

remark str

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

Outputs

All input properties are implicitly available as output properties. Additionally, the Topic resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Topic Resource

Get an existing Topic resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TopicState, opts?: CustomResourceOptions): Topic
static get(resource_name, id, opts=None, instance_id=None, message_type=None, perm=None, remark=None, topic=None, __props__=None);
func GetTopic(ctx *Context, name string, id IDInput, state *TopicState, opts ...ResourceOption) (*Topic, error)
public static Topic Get(string name, Input<string> id, TopicState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

InstanceId string

ID of the ONS Instance that owns the topics.

MessageType int

The type of the message. Read Ons Topic Create for further details.

Perm int

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

Remark string

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

TopicName string

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

InstanceId string

ID of the ONS Instance that owns the topics.

MessageType int

The type of the message. Read Ons Topic Create for further details.

Perm int

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

Remark string

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

Topic string

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

instanceId string

ID of the ONS Instance that owns the topics.

messageType number

The type of the message. Read Ons Topic Create for further details.

perm number

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

remark string

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

topic string

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

instance_id str

ID of the ONS Instance that owns the topics.

message_type float

The type of the message. Read Ons Topic Create for further details.

perm float

This attribute is used to set the read-write mode for the topic. Read Request parameters for further details.

remark str

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

topic str

Name of the topic. Two topics on a single instance cannot have the same name and the name cannot start with ‘GID’ or ‘CID’. The length cannot exceed 64 characters.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.