1. Packages
  2. Alicloud Provider
  3. API Docs
  4. mns
  5. getTopicSubscriptions
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.mns.getTopicSubscriptions

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides a list of MNS topic subscriptions in an Alibaba Cloud account according to the specified parameters.

    DEPRECATED: This datasource has been deprecated from version 1.188.0. Please use new datasource message_service_subscriptions.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const subscriptions = alicloud.mns.getTopicSubscriptions({
        topicName: "topic_name",
        namePrefix: "tf-",
    });
    export const firstTopicSubscriptionId = subscriptions.then(subscriptions => subscriptions.subscriptions?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    subscriptions = alicloud.mns.get_topic_subscriptions(topic_name="topic_name",
        name_prefix="tf-")
    pulumi.export("firstTopicSubscriptionId", subscriptions.subscriptions[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mns"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		subscriptions, err := mns.GetTopicSubscriptions(ctx, &mns.GetTopicSubscriptionsArgs{
    			TopicName:  "topic_name",
    			NamePrefix: pulumi.StringRef("tf-"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstTopicSubscriptionId", subscriptions.Subscriptions[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var subscriptions = AliCloud.Mns.GetTopicSubscriptions.Invoke(new()
        {
            TopicName = "topic_name",
            NamePrefix = "tf-",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstTopicSubscriptionId"] = subscriptions.Apply(getTopicSubscriptionsResult => getTopicSubscriptionsResult.Subscriptions[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.mns.MnsFunctions;
    import com.pulumi.alicloud.mns.inputs.GetTopicSubscriptionsArgs;
    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 subscriptions = MnsFunctions.getTopicSubscriptions(GetTopicSubscriptionsArgs.builder()
                .topicName("topic_name")
                .namePrefix("tf-")
                .build());
    
            ctx.export("firstTopicSubscriptionId", subscriptions.applyValue(getTopicSubscriptionsResult -> getTopicSubscriptionsResult.subscriptions()[0].id()));
        }
    }
    
    variables:
      subscriptions:
        fn::invoke:
          Function: alicloud:mns:getTopicSubscriptions
          Arguments:
            topicName: topic_name
            namePrefix: tf-
    outputs:
      firstTopicSubscriptionId: ${subscriptions.subscriptions[0].id}
    

    Using getTopicSubscriptions

    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 getTopicSubscriptions(args: GetTopicSubscriptionsArgs, opts?: InvokeOptions): Promise<GetTopicSubscriptionsResult>
    function getTopicSubscriptionsOutput(args: GetTopicSubscriptionsOutputArgs, opts?: InvokeOptions): Output<GetTopicSubscriptionsResult>
    def get_topic_subscriptions(name_prefix: Optional[str] = None,
                                output_file: Optional[str] = None,
                                topic_name: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetTopicSubscriptionsResult
    def get_topic_subscriptions_output(name_prefix: Optional[pulumi.Input[str]] = None,
                                output_file: Optional[pulumi.Input[str]] = None,
                                topic_name: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetTopicSubscriptionsResult]
    func GetTopicSubscriptions(ctx *Context, args *GetTopicSubscriptionsArgs, opts ...InvokeOption) (*GetTopicSubscriptionsResult, error)
    func GetTopicSubscriptionsOutput(ctx *Context, args *GetTopicSubscriptionsOutputArgs, opts ...InvokeOption) GetTopicSubscriptionsResultOutput

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

    public static class GetTopicSubscriptions 
    {
        public static Task<GetTopicSubscriptionsResult> InvokeAsync(GetTopicSubscriptionsArgs args, InvokeOptions? opts = null)
        public static Output<GetTopicSubscriptionsResult> Invoke(GetTopicSubscriptionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTopicSubscriptionsResult> getTopicSubscriptions(GetTopicSubscriptionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:mns/getTopicSubscriptions:getTopicSubscriptions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TopicName string
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    NamePrefix string
    A string to filter resulting subscriptions of the topic by their name prefixs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    TopicName string
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    NamePrefix string
    A string to filter resulting subscriptions of the topic by their name prefixs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    topicName String
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    namePrefix String
    A string to filter resulting subscriptions of the topic by their name prefixs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    topicName string
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    namePrefix string
    A string to filter resulting subscriptions of the topic by their name prefixs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    topic_name str
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    name_prefix str
    A string to filter resulting subscriptions of the topic by their name prefixs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    topicName String
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    namePrefix String
    A string to filter resulting subscriptions of the topic by their name prefixs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getTopicSubscriptions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Names List<string>
    A list of subscription names.
    Subscriptions List<Pulumi.AliCloud.Mns.Outputs.GetTopicSubscriptionsSubscription>
    A list of subscriptions. Each element contains the following attributes:
    TopicName string
    The topic which The subscription belongs to was named with the name.
    NamePrefix string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Names []string
    A list of subscription names.
    Subscriptions []GetTopicSubscriptionsSubscription
    A list of subscriptions. Each element contains the following attributes:
    TopicName string
    The topic which The subscription belongs to was named with the name.
    NamePrefix string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    A list of subscription names.
    subscriptions List<GetTopicSubscriptionsSubscription>
    A list of subscriptions. Each element contains the following attributes:
    topicName String
    The topic which The subscription belongs to was named with the name.
    namePrefix String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    names string[]
    A list of subscription names.
    subscriptions GetTopicSubscriptionsSubscription[]
    A list of subscriptions. Each element contains the following attributes:
    topicName string
    The topic which The subscription belongs to was named with the name.
    namePrefix string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    names Sequence[str]
    A list of subscription names.
    subscriptions Sequence[GetTopicSubscriptionsSubscription]
    A list of subscriptions. Each element contains the following attributes:
    topic_name str
    The topic which The subscription belongs to was named with the name.
    name_prefix str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    names List<String>
    A list of subscription names.
    subscriptions List<Property Map>
    A list of subscriptions. Each element contains the following attributes:
    topicName String
    The topic which The subscription belongs to was named with the name.
    namePrefix String
    outputFile String

    Supporting Types

    GetTopicSubscriptionsSubscription

    Endpoint string
    Describe the terminal address of the message received in this subscription.
    FilterTag string
    A string to filter resulting messages of the topic by their message tag.
    Id string
    The ID of the topic subscription. The value is set to name.
    Name string
    The name of the subscription.
    NotifyContentFormat string
    The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
    NotifyStrategy string
    The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
    TopicName string
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    Endpoint string
    Describe the terminal address of the message received in this subscription.
    FilterTag string
    A string to filter resulting messages of the topic by their message tag.
    Id string
    The ID of the topic subscription. The value is set to name.
    Name string
    The name of the subscription.
    NotifyContentFormat string
    The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
    NotifyStrategy string
    The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
    TopicName string
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    endpoint String
    Describe the terminal address of the message received in this subscription.
    filterTag String
    A string to filter resulting messages of the topic by their message tag.
    id String
    The ID of the topic subscription. The value is set to name.
    name String
    The name of the subscription.
    notifyContentFormat String
    The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
    notifyStrategy String
    The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
    topicName String
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    endpoint string
    Describe the terminal address of the message received in this subscription.
    filterTag string
    A string to filter resulting messages of the topic by their message tag.
    id string
    The ID of the topic subscription. The value is set to name.
    name string
    The name of the subscription.
    notifyContentFormat string
    The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
    notifyStrategy string
    The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
    topicName string
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    endpoint str
    Describe the terminal address of the message received in this subscription.
    filter_tag str
    A string to filter resulting messages of the topic by their message tag.
    id str
    The ID of the topic subscription. The value is set to name.
    name str
    The name of the subscription.
    notify_content_format str
    The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
    notify_strategy str
    The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
    topic_name str
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.
    endpoint String
    Describe the terminal address of the message received in this subscription.
    filterTag String
    A string to filter resulting messages of the topic by their message tag.
    id String
    The ID of the topic subscription. The value is set to name.
    name String
    The name of the subscription.
    notifyContentFormat String
    The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
    notifyStrategy String
    The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
    topicName String
    Two topics on a single account in the same region cannot have the same name. A topic name must start with an English letter or a digit, and can contain English letters, digits, and hyphens, with the length not exceeding 256 characters.

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi