GetTopics
This data source provides a list of ONS Topics in an Alibaba Cloud account according to the specified filters.
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") ?? "onsTopicDatasourceName";
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,
});
var topicsDs = defaultTopic.InstanceId.Apply(instanceId => AliCloud.RocketMQ.GetTopics.InvokeAsync(new AliCloud.RocketMQ.GetTopicsArgs
{
InstanceId = instanceId,
NameRegex = topic,
OutputFile = "topics.txt",
}));
this.FirstTopicName = topicsDs.Apply(topicsDs => topicsDs.Topics[0].Topic);
}
[Output("firstTopicName")]
public Output<string> FirstTopicName { get; set; }
}
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 = "onsTopicDatasourceName"
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)
topics_ds = default_topic.instance_id.apply(lambda instance_id: alicloud.rocketmq.get_topics(instance_id=instance_id,
name_regex=topic,
output_file="topics.txt"))
pulumi.export("firstTopicName", topics_ds.topics[0]["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") || "onsTopicDatasourceName";
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,
});
const topicsDs = defaultTopic.instanceId.apply(instanceId => alicloud.rocketmq.getTopics({
instanceId: instanceId,
nameRegex: topic,
outputFile: "topics.txt",
}, { async: true }));
export const firstTopicName = topicsDs.topics[0].topic;Using GetTopics
function getTopics(args: GetTopicsArgs, opts?: InvokeOptions): Promise<GetTopicsResult>function get_topics(instance_id=None, name_regex=None, output_file=None, opts=None)func GetTopics(ctx *Context, args *GetTopicsArgs, opts ...InvokeOption) (*GetTopicsResult, error)public static class GetTopics {
public static Task<GetTopicsResult> InvokeAsync(GetTopicsArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Instance
Id string ID of the ONS Instance that owns the topics.
- Name
Regex string A regex string to filter results by the topic name.
- Output
File string
- Instance
Id string ID of the ONS Instance that owns the topics.
- Name
Regex string A regex string to filter results by the topic name.
- Output
File string
- instance
Id string ID of the ONS Instance that owns the topics.
- name
Regex string A regex string to filter results by the topic name.
- output
File string
- instance_
id str ID of the ONS Instance that owns the topics.
- name_
regex str A regex string to filter results by the topic name.
- output_
file str
GetTopics Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id string - Names List<string>
A list of topic names.
- Topics
List<Pulumi.
Ali Cloud. Rocket MQ. Outputs. Get Topics Topic> A list of topics. Each element contains the following attributes:
- Name
Regex string - Output
File string
- Id string
The provider-assigned unique ID for this managed resource.
- Instance
Id string - Names []string
A list of topic names.
- Topics
[]Get
Topics Topic A list of topics. Each element contains the following attributes:
- Name
Regex string - Output
File string
- id string
The provider-assigned unique ID for this managed resource.
- instance
Id string - names string[]
A list of topic names.
- topics
Get
Topics Topic[] A list of topics. Each element contains the following attributes:
- name
Regex string - output
File string
- id str
The provider-assigned unique ID for this managed resource.
- instance_
id str - names List[str]
A list of topic names.
- topics
List[Get
Topics Topic] A list of topics. Each element contains the following attributes:
- name_
regex str - output_
file str
Supporting Types
GetTopicsTopic
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Create
Time string Time of creation.
- Independent
Naming bool Indicates whether namespaces are available. Read Fields in PublishInfoDo for further details.
- Message
Type int The type of the message. Read Fields in PublishInfoDo for further details.
- Owner string
The ID of the topic owner, which is the Alibaba Cloud UID.
- Relation int
The relation ID. Read Fields in PublishInfoDo for further details.
- Relation
Name string The name of the relation, for example, owner, publishable, subscribable, and publishable and subscribable.
- Remark string
Remark of the topic.
- Topic string
The name of the topic.
- Create
Time string Time of creation.
- Independent
Naming bool Indicates whether namespaces are available. Read Fields in PublishInfoDo for further details.
- Message
Type int The type of the message. Read Fields in PublishInfoDo for further details.
- Owner string
The ID of the topic owner, which is the Alibaba Cloud UID.
- Relation int
The relation ID. Read Fields in PublishInfoDo for further details.
- Relation
Name string The name of the relation, for example, owner, publishable, subscribable, and publishable and subscribable.
- Remark string
Remark of the topic.
- Topic string
The name of the topic.
- create
Time string Time of creation.
- independent
Naming boolean Indicates whether namespaces are available. Read Fields in PublishInfoDo for further details.
- message
Type number The type of the message. Read Fields in PublishInfoDo for further details.
- owner string
The ID of the topic owner, which is the Alibaba Cloud UID.
- relation number
The relation ID. Read Fields in PublishInfoDo for further details.
- relation
Name string The name of the relation, for example, owner, publishable, subscribable, and publishable and subscribable.
- remark string
Remark of the topic.
- topic string
The name of the topic.
- create_
time str Time of creation.
- independent
Naming bool Indicates whether namespaces are available. Read Fields in PublishInfoDo for further details.
- message_
type float The type of the message. Read Fields in PublishInfoDo for further details.
- owner str
The ID of the topic owner, which is the Alibaba Cloud UID.
- relation float
The relation ID. Read Fields in PublishInfoDo for further details.
- relation
Name str The name of the relation, for example, owner, publishable, subscribable, and publishable and subscribable.
- remark str
Remark of the topic.
- topic str
The name of the topic.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.