Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.mns.getTopicSubscriptions
Explore with Pulumi AI
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:
- Topic
Name 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.
- Name
Prefix string - A string to filter resulting subscriptions of the topic by their name prefixs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Topic
Name 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.
- Name
Prefix string - A string to filter resulting subscriptions of the topic by their name prefixs.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- topic
Name 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.
- name
Prefix String - A string to filter resulting subscriptions of the topic by their name prefixs.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- topic
Name 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.
- name
Prefix string - A string to filter resulting subscriptions of the topic by their name prefixs.
- output
File 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
).
- topic
Name 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.
- name
Prefix String - A string to filter resulting subscriptions of the topic by their name prefixs.
- output
File 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.
Ali Cloud. Mns. Outputs. Get Topic Subscriptions Subscription> - A list of subscriptions. Each element contains the following attributes:
- Topic
Name string - The topic which The subscription belongs to was named with the name.
- Name
Prefix string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Names []string
- A list of subscription names.
- Subscriptions
[]Get
Topic Subscriptions Subscription - A list of subscriptions. Each element contains the following attributes:
- Topic
Name string - The topic which The subscription belongs to was named with the name.
- Name
Prefix string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- names List<String>
- A list of subscription names.
- subscriptions
List<Get
Topic Subscriptions Subscription> - A list of subscriptions. Each element contains the following attributes:
- topic
Name String - The topic which The subscription belongs to was named with the name.
- name
Prefix String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- names string[]
- A list of subscription names.
- subscriptions
Get
Topic Subscriptions Subscription[] - A list of subscriptions. Each element contains the following attributes:
- topic
Name string - The topic which The subscription belongs to was named with the name.
- name
Prefix string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- names Sequence[str]
- A list of subscription names.
- subscriptions
Sequence[Get
Topic Subscriptions Subscription] - 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:
- topic
Name String - The topic which The subscription belongs to was named with the name.
- name
Prefix String - output
File String
Supporting Types
GetTopicSubscriptionsSubscription
- Endpoint string
- Describe the terminal address of the message received in this subscription.
- Filter
Tag 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.
- Notify
Content stringFormat - The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
- Notify
Strategy string - The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
- Topic
Name 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.
- Filter
Tag 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.
- Notify
Content stringFormat - The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
- Notify
Strategy string - The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
- Topic
Name 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.
- filter
Tag 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.
- notify
Content StringFormat - The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
- notify
Strategy String - The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
- topic
Name 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.
- filter
Tag 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.
- notify
Content stringFormat - The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
- notify
Strategy string - The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
- topic
Name 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_ strformat - 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.
- filter
Tag 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.
- notify
Content StringFormat - The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users.
- notify
Strategy String - The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails.
- topic
Name 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.