Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.message.getServiceSubscriptions
Explore with Pulumi AI
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:
- Topic
Name string - The name of the topic.
- Ids List<string>
- A list of Subscription IDs.
- Name
Regex string - A regex string to filter results by Subscription name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int - Subscription
Name string - The name of the subscription.
- Topic
Name string - The name of the topic.
- Ids []string
- A list of Subscription IDs.
- Name
Regex string - A regex string to filter results by Subscription name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Page
Number int - Page
Size int - Subscription
Name string - The name of the subscription.
- topic
Name String - The name of the topic.
- ids List<String>
- A list of Subscription IDs.
- name
Regex String - A regex string to filter results by Subscription name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Integer - page
Size Integer - subscription
Name String - The name of the subscription.
- topic
Name string - The name of the topic.
- ids string[]
- A list of Subscription IDs.
- name
Regex string - A regex string to filter results by Subscription name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - page
Number number - page
Size number - subscription
Name 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.
- topic
Name String - The name of the topic.
- ids List<String>
- A list of Subscription IDs.
- name
Regex String - A regex string to filter results by Subscription name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - page
Number Number - page
Size Number - subscription
Name 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.
Ali Cloud. Message. Outputs. Get Service Subscriptions Subscription> - A list of Subscriptions. Each element contains the following attributes:
- Topic
Name string - The name of the topic.
- Name
Regex string - Output
File string - Page
Number int - Page
Size int - Subscription
Name 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
[]Get
Service Subscriptions Subscription - A list of Subscriptions. Each element contains the following attributes:
- Topic
Name string - The name of the topic.
- Name
Regex string - Output
File string - Page
Number int - Page
Size int - Subscription
Name 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<Get
Service Subscriptions Subscription> - A list of Subscriptions. Each element contains the following attributes:
- topic
Name String - The name of the topic.
- name
Regex String - output
File String - page
Number Integer - page
Size Integer - subscription
Name 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
Get
Service Subscriptions Subscription[] - A list of Subscriptions. Each element contains the following attributes:
- topic
Name string - The name of the topic.
- name
Regex string - output
File string - page
Number number - page
Size number - subscription
Name 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[Get
Service Subscriptions Subscription] - 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:
- topic
Name String - The name of the topic.
- name
Regex String - output
File String - page
Number Number - page
Size Number - subscription
Name String - The name of the subscription.
Supporting Types
GetServiceSubscriptionsSubscription
- 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 string
- The endpoint to which the messages are pushed.
- Filter
Tag 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.
- Last
Modify intTime - 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 stringFormat - The content format of the messages that are pushed to the endpoint.
- Notify
Strategy string - The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
- Subscription
Name string - The name of the subscription.
- Subscription
Url string - The url of the subscription.
- Topic
Name string - The name of the topic.
- Topic
Owner 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 string
- The endpoint to which the messages are pushed.
- Filter
Tag 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.
- Last
Modify intTime - 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 stringFormat - The content format of the messages that are pushed to the endpoint.
- Notify
Strategy string - The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
- Subscription
Name string - The name of the subscription.
- Subscription
Url string - The url of the subscription.
- Topic
Name string - The name of the topic.
- Topic
Owner string - The account ID of the topic owner.
- create
Time 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.
- filter
Tag 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.
- last
Modify IntegerTime - 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 StringFormat - The content format of the messages that are pushed to the endpoint.
- notify
Strategy String - The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
- subscription
Name String - The name of the subscription.
- subscription
Url String - The url of the subscription.
- topic
Name String - The name of the topic.
- topic
Owner String - The account ID of the topic owner.
- create
Time 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.
- filter
Tag 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.
- last
Modify numberTime - 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 stringFormat - The content format of the messages that are pushed to the endpoint.
- notify
Strategy string - The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
- subscription
Name string - The name of the subscription.
- subscription
Url string - The url of the subscription.
- topic
Name string - The name of the topic.
- topic
Owner 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_ inttime - 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_ strformat - 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.
- create
Time 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.
- filter
Tag 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.
- last
Modify NumberTime - 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 StringFormat - The content format of the messages that are pushed to the endpoint.
- notify
Strategy String - The retry policy that is applied if an error occurs when MNS pushes messages to the endpoint.
- subscription
Name String - The name of the subscription.
- subscription
Url String - The url of the subscription.
- topic
Name String - The name of the topic.
- topic
Owner 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.