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

alicloud.message.getServiceSubscriptions

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 Subscriptions 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.getServiceSubscriptions({
        ids: ["example_id"],
        topicName: "tf-example",
    });
    export const subscriptionId1 = ids.then(ids => ids.subscriptions?.[0]?.id);
    const name = alicloud.message.getServiceSubscriptions({
        topicName: "tf-example",
    });
    export const subscriptionId2 = name.then(name => name.subscriptions?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.message.get_service_subscriptions(ids=["example_id"],
        topic_name="tf-example")
    pulumi.export("subscriptionId1", ids.subscriptions[0].id)
    name = alicloud.message.get_service_subscriptions(topic_name="tf-example")
    pulumi.export("subscriptionId2", name.subscriptions[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.GetServiceSubscriptions(ctx, &message.GetServiceSubscriptionsArgs{
    			Ids: []string{
    				"example_id",
    			},
    			TopicName: "tf-example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("subscriptionId1", ids.Subscriptions[0].Id)
    		name, err := message.GetServiceSubscriptions(ctx, &message.GetServiceSubscriptionsArgs{
    			TopicName: "tf-example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("subscriptionId2", name.Subscriptions[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.GetServiceSubscriptions.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
            TopicName = "tf-example",
        });
    
        var name = AliCloud.Message.GetServiceSubscriptions.Invoke(new()
        {
            TopicName = "tf-example",
        });
    
        return new Dictionary<string, object?>
        {
            ["subscriptionId1"] = ids.Apply(getServiceSubscriptionsResult => getServiceSubscriptionsResult.Subscriptions[0]?.Id),
            ["subscriptionId2"] = name.Apply(getServiceSubscriptionsResult => getServiceSubscriptionsResult.Subscriptions[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.GetServiceSubscriptionsArgs;
    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.getServiceSubscriptions(GetServiceSubscriptionsArgs.builder()
                .ids("example_id")
                .topicName("tf-example")
                .build());
    
            ctx.export("subscriptionId1", ids.applyValue(getServiceSubscriptionsResult -> getServiceSubscriptionsResult.subscriptions()[0].id()));
            final var name = MessageFunctions.getServiceSubscriptions(GetServiceSubscriptionsArgs.builder()
                .topicName("tf-example")
                .build());
    
            ctx.export("subscriptionId2", name.applyValue(getServiceSubscriptionsResult -> getServiceSubscriptionsResult.subscriptions()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:message:getServiceSubscriptions
          Arguments:
            ids:
              - example_id
            topicName: tf-example
      name:
        fn::invoke:
          Function: alicloud:message:getServiceSubscriptions
          Arguments:
            topicName: tf-example
    outputs:
      subscriptionId1: ${ids.subscriptions[0].id}
      subscriptionId2: ${name.subscriptions[0].id}
    

    Using getServiceSubscriptions

    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 getServiceSubscriptions(args: GetServiceSubscriptionsArgs, opts?: InvokeOptions): Promise<GetServiceSubscriptionsResult>
    function getServiceSubscriptionsOutput(args: GetServiceSubscriptionsOutputArgs, opts?: InvokeOptions): Output<GetServiceSubscriptionsResult>
    def get_service_subscriptions(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,
                                  subscription_name: Optional[str] = None,
                                  topic_name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetServiceSubscriptionsResult
    def get_service_subscriptions_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,
                                  subscription_name: Optional[pulumi.Input[str]] = None,
                                  topic_name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetServiceSubscriptionsResult]
    func GetServiceSubscriptions(ctx *Context, args *GetServiceSubscriptionsArgs, opts ...InvokeOption) (*GetServiceSubscriptionsResult, error)
    func GetServiceSubscriptionsOutput(ctx *Context, args *GetServiceSubscriptionsOutputArgs, opts ...InvokeOption) GetServiceSubscriptionsResultOutput

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

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

    The following arguments are supported:

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

    getServiceSubscriptions 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 Subscription names.
    Subscriptions List<Pulumi.AliCloud.Message.Outputs.GetServiceSubscriptionsSubscription>
    A list of Subscriptions. Each element contains the following attributes:
    TopicName string
    The name of the topic.
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    SubscriptionName string
    The name of the subscription.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    A list of Subscription names.
    Subscriptions []GetServiceSubscriptionsSubscription
    A list of Subscriptions. Each element contains the following attributes:
    TopicName string
    The name of the topic.
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    SubscriptionName string
    The name of the subscription.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    A list of Subscription names.
    subscriptions List<GetServiceSubscriptionsSubscription>
    A list of Subscriptions. Each element contains the following attributes:
    topicName String
    The name of the topic.
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    subscriptionName String
    The name of the subscription.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    A list of Subscription names.
    subscriptions GetServiceSubscriptionsSubscription[]
    A list of Subscriptions. Each element contains the following attributes:
    topicName string
    The name of the topic.
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    subscriptionName string
    The name of the subscription.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    A list of Subscription names.
    subscriptions Sequence[GetServiceSubscriptionsSubscription]
    A list of Subscriptions. Each element contains the following attributes:
    topic_name str
    The name of the topic.
    name_regex str
    output_file str
    page_number int
    page_size int
    subscription_name str
    The name of the subscription.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    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 name of the topic.
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number
    subscriptionName String
    The name of the subscription.

    Supporting Types

    GetServiceSubscriptionsSubscription

    CreateTime int
    The time when the subscription 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.
    Endpoint string
    The endpoint to which the messages are pushed.
    FilterTag string
    The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    Id string
    The id of the Subscription.
    LastModifyTime int
    The time when the subscription 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.
    NotifyContentFormat string
    The content format of the messages that are pushed to the endpoint.
    NotifyStrategy string
    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    SubscriptionName string
    The name of the subscription.
    SubscriptionUrl string
    The url of the subscription.
    TopicName string
    The name of the topic.
    TopicOwner string
    The account ID of the topic owner.
    CreateTime int
    The time when the subscription 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.
    Endpoint string
    The endpoint to which the messages are pushed.
    FilterTag string
    The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    Id string
    The id of the Subscription.
    LastModifyTime int
    The time when the subscription 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.
    NotifyContentFormat string
    The content format of the messages that are pushed to the endpoint.
    NotifyStrategy string
    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    SubscriptionName string
    The name of the subscription.
    SubscriptionUrl string
    The url of the subscription.
    TopicName string
    The name of the topic.
    TopicOwner string
    The account ID of the topic owner.
    createTime Integer
    The time when the subscription 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.
    endpoint String
    The endpoint to which the messages are pushed.
    filterTag String
    The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    id String
    The id of the Subscription.
    lastModifyTime Integer
    The time when the subscription 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.
    notifyContentFormat String
    The content format of the messages that are pushed to the endpoint.
    notifyStrategy String
    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    subscriptionName String
    The name of the subscription.
    subscriptionUrl String
    The url of the subscription.
    topicName String
    The name of the topic.
    topicOwner String
    The account ID of the topic owner.
    createTime number
    The time when the subscription 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.
    endpoint string
    The endpoint to which the messages are pushed.
    filterTag string
    The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    id string
    The id of the Subscription.
    lastModifyTime number
    The time when the subscription 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.
    notifyContentFormat string
    The content format of the messages that are pushed to the endpoint.
    notifyStrategy string
    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    subscriptionName string
    The name of the subscription.
    subscriptionUrl string
    The url of the subscription.
    topicName string
    The name of the topic.
    topicOwner string
    The account ID of the topic owner.
    create_time int
    The time when the subscription 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.
    endpoint str
    The endpoint to which the messages are pushed.
    filter_tag str
    The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    id str
    The id of the Subscription.
    last_modify_time int
    The time when the subscription 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.
    notify_content_format str
    The content format of the messages that are pushed to the endpoint.
    notify_strategy str
    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    subscription_name str
    The name of the subscription.
    subscription_url str
    The url of the subscription.
    topic_name str
    The name of the topic.
    topic_owner str
    The account ID of the topic owner.
    createTime Number
    The time when the subscription 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.
    endpoint String
    The endpoint to which the messages are pushed.
    filterTag String
    The tag that is used to filter messages. Only the messages that are attached with the specified tag can be pushed.
    id String
    The id of the Subscription.
    lastModifyTime Number
    The time when the subscription 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.
    notifyContentFormat String
    The content format of the messages that are pushed to the endpoint.
    notifyStrategy String
    The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
    subscriptionName String
    The name of the subscription.
    subscriptionUrl String
    The url of the subscription.
    topicName String
    The name of the topic.
    topicOwner String
    The account ID of the topic owner.

    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