1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. message
  5. getServiceTopics
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.message.getServiceTopics

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Message Notification Service Topics of the current Alibaba Cloud user.

    NOTE: Available in v1.188.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.message.getServiceTopics({
        ids: ["example_id"],
    });
    export const topicId1 = ids.then(ids => ids.topics?.[0]?.id);
    const name = alicloud.message.getServiceTopics({
        topicName: "tf-example",
    });
    export const topicId2 = name.then(name => name.topics?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.message.get_service_topics(ids=["example_id"])
    pulumi.export("topicId1", ids.topics[0].id)
    name = alicloud.message.get_service_topics(topic_name="tf-example")
    pulumi.export("topicId2", name.topics[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/message"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := message.GetServiceTopics(ctx, &message.GetServiceTopicsArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("topicId1", ids.Topics[0].Id)
    		name, err := message.GetServiceTopics(ctx, &message.GetServiceTopicsArgs{
    			TopicName: pulumi.StringRef("tf-example"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("topicId2", name.Topics[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Message.GetServiceTopics.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var name = AliCloud.Message.GetServiceTopics.Invoke(new()
        {
            TopicName = "tf-example",
        });
    
        return new Dictionary<string, object?>
        {
            ["topicId1"] = ids.Apply(getServiceTopicsResult => getServiceTopicsResult.Topics[0]?.Id),
            ["topicId2"] = name.Apply(getServiceTopicsResult => getServiceTopicsResult.Topics[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.message.MessageFunctions;
    import com.pulumi.alicloud.message.inputs.GetServiceTopicsArgs;
    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 ids = MessageFunctions.getServiceTopics(GetServiceTopicsArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("topicId1", ids.applyValue(getServiceTopicsResult -> getServiceTopicsResult.topics()[0].id()));
            final var name = MessageFunctions.getServiceTopics(GetServiceTopicsArgs.builder()
                .topicName("tf-example")
                .build());
    
            ctx.export("topicId2", name.applyValue(getServiceTopicsResult -> getServiceTopicsResult.topics()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:message:getServiceTopics
          Arguments:
            ids:
              - example_id
      name:
        fn::invoke:
          Function: alicloud:message:getServiceTopics
          Arguments:
            topicName: tf-example
    outputs:
      topicId1: ${ids.topics[0].id}
      topicId2: ${name.topics[0].id}
    

    Using getServiceTopics

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getServiceTopics(args: GetServiceTopicsArgs, opts?: InvokeOptions): Promise<GetServiceTopicsResult>
    function getServiceTopicsOutput(args: GetServiceTopicsOutputArgs, opts?: InvokeOptions): Output<GetServiceTopicsResult>
    def get_service_topics(ids: Optional[Sequence[str]] = None,
                           name_regex: Optional[str] = None,
                           output_file: Optional[str] = None,
                           page_number: Optional[int] = None,
                           page_size: Optional[int] = None,
                           topic_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetServiceTopicsResult
    def get_service_topics_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           name_regex: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           page_number: Optional[pulumi.Input[int]] = None,
                           page_size: Optional[pulumi.Input[int]] = None,
                           topic_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetServiceTopicsResult]
    func GetServiceTopics(ctx *Context, args *GetServiceTopicsArgs, opts ...InvokeOption) (*GetServiceTopicsResult, error)
    func GetServiceTopicsOutput(ctx *Context, args *GetServiceTopicsOutputArgs, opts ...InvokeOption) GetServiceTopicsResultOutput

    > Note: This function is named GetServiceTopics in the Go SDK.

    public static class GetServiceTopics 
    {
        public static Task<GetServiceTopicsResult> InvokeAsync(GetServiceTopicsArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceTopicsResult> Invoke(GetServiceTopicsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceTopicsResult> getServiceTopics(GetServiceTopicsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:message/getServiceTopics:getServiceTopics
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Topic IDs. Its element value is same as Topic Name.
    NameRegex string
    A regex string to filter results by Topic name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    TopicName string
    The name of the topic.
    Ids []string
    A list of Topic IDs. Its element value is same as Topic Name.
    NameRegex string
    A regex string to filter results by Topic name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    TopicName string
    The name of the topic.
    ids List<String>
    A list of Topic IDs. Its element value is same as Topic Name.
    nameRegex String
    A regex string to filter results by Topic name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    topicName String
    The name of the topic.
    ids string[]
    A list of Topic IDs. Its element value is same as Topic Name.
    nameRegex string
    A regex string to filter results by Topic name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    topicName string
    The name of the topic.
    ids Sequence[str]
    A list of Topic IDs. Its element value is same as Topic Name.
    name_regex str
    A regex string to filter results by Topic name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    topic_name str
    The name of the topic.
    ids List<String>
    A list of Topic IDs. Its element value is same as Topic Name.
    nameRegex String
    A regex string to filter results by Topic name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    topicName String
    The name of the topic.

    getServiceTopics Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    A list of Topic names.
    Topics List<Pulumi.AliCloud.Message.Outputs.GetServiceTopicsTopic>
    A list of Topics. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    TopicName string
    The name of the topic.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Topic names.
    Topics []GetServiceTopicsTopic
    A list of Topics. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    TopicName string
    The name of the topic.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Topic names.
    topics List<GetServiceTopicsTopic>
    A list of Topics. Each element contains the following attributes:
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    topicName String
    The name of the topic.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Topic names.
    topics GetServiceTopicsTopic[]
    A list of Topics. Each element contains the following attributes:
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    topicName string
    The name of the topic.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Topic names.
    topics Sequence[GetServiceTopicsTopic]
    A list of Topics. Each element contains the following attributes:
    name_regex str
    output_file str
    page_number int
    page_size int
    topic_name str
    The name of the topic.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Topic names.
    topics List<Property Map>
    A list of Topics. Each element contains the following attributes:
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number
    topicName String
    The name of the topic.

    Supporting Types

    GetServiceTopicsTopic

    CreateTime int
    The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    Id string
    The id of the Topic. Its value is same as Topic Name.
    LastModifyTime int
    The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    LoggingEnabled bool
    Indicates whether the log management feature is enabled.
    MaxMessageSize int
    The maximum size of a message body that can be sent to the topic. Unit: bytes.
    MessageCount int
    The number of messages in the topic.
    MessageRetentionPeriod int
    The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds.
    TopicInnerUrl string
    The inner url of the topic.
    TopicName string
    The name of the topic.
    TopicUrl string
    The url of the topic.
    CreateTime int
    The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    Id string
    The id of the Topic. Its value is same as Topic Name.
    LastModifyTime int
    The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    LoggingEnabled bool
    Indicates whether the log management feature is enabled.
    MaxMessageSize int
    The maximum size of a message body that can be sent to the topic. Unit: bytes.
    MessageCount int
    The number of messages in the topic.
    MessageRetentionPeriod int
    The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds.
    TopicInnerUrl string
    The inner url of the topic.
    TopicName string
    The name of the topic.
    TopicUrl string
    The url of the topic.
    createTime Integer
    The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    id String
    The id of the Topic. Its value is same as Topic Name.
    lastModifyTime Integer
    The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    loggingEnabled Boolean
    Indicates whether the log management feature is enabled.
    maxMessageSize Integer
    The maximum size of a message body that can be sent to the topic. Unit: bytes.
    messageCount Integer
    The number of messages in the topic.
    messageRetentionPeriod Integer
    The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds.
    topicInnerUrl String
    The inner url of the topic.
    topicName String
    The name of the topic.
    topicUrl String
    The url of the topic.
    createTime number
    The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    id string
    The id of the Topic. Its value is same as Topic Name.
    lastModifyTime number
    The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    loggingEnabled boolean
    Indicates whether the log management feature is enabled.
    maxMessageSize number
    The maximum size of a message body that can be sent to the topic. Unit: bytes.
    messageCount number
    The number of messages in the topic.
    messageRetentionPeriod number
    The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds.
    topicInnerUrl string
    The inner url of the topic.
    topicName string
    The name of the topic.
    topicUrl string
    The url of the topic.
    create_time int
    The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    id str
    The id of the Topic. Its value is same as Topic Name.
    last_modify_time int
    The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    logging_enabled bool
    Indicates whether the log management feature is enabled.
    max_message_size int
    The maximum size of a message body that can be sent to the topic. Unit: bytes.
    message_count int
    The number of messages in the topic.
    message_retention_period int
    The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds.
    topic_inner_url str
    The inner url of the topic.
    topic_name str
    The name of the topic.
    topic_url str
    The url of the topic.
    createTime Number
    The time when the topic was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    id String
    The id of the Topic. Its value is same as Topic Name.
    lastModifyTime Number
    The time when the topic was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
    loggingEnabled Boolean
    Indicates whether the log management feature is enabled.
    maxMessageSize Number
    The maximum size of a message body that can be sent to the topic. Unit: bytes.
    messageCount Number
    The number of messages in the topic.
    messageRetentionPeriod Number
    The maximum period for which a message can be retained in the topic. A message that is sent to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints. Unit: seconds.
    topicInnerUrl String
    The inner url of the topic.
    topicName String
    The name of the topic.
    topicUrl String
    The url of the topic.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi