TopicSubscription

class TopicSubscription : KotlinCustomResource

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const topic = new alicloud.mns.Topic("topic", {
name: "tf-example-mnstopic",
maximumMessageSize: 65536,
loggingEnabled: false,
});
const subscription = new alicloud.mns.TopicSubscription("subscription", {
topicName: "tf-example-mnstopic",
name: "tf-example-mnstopic-sub",
filterTag: "test",
endpoint: "http://www.xxx.com/xxx",
notifyStrategy: "BACKOFF_RETRY",
notifyContentFormat: "XML",
});
import pulumi
import pulumi_alicloud as alicloud
topic = alicloud.mns.Topic("topic",
name="tf-example-mnstopic",
maximum_message_size=65536,
logging_enabled=False)
subscription = alicloud.mns.TopicSubscription("subscription",
topic_name="tf-example-mnstopic",
name="tf-example-mnstopic-sub",
filter_tag="test",
endpoint="http://www.xxx.com/xxx",
notify_strategy="BACKOFF_RETRY",
notify_content_format="XML")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var topic = new AliCloud.Mns.Topic("topic", new()
{
Name = "tf-example-mnstopic",
MaximumMessageSize = 65536,
LoggingEnabled = false,
});
var subscription = new AliCloud.Mns.TopicSubscription("subscription", new()
{
TopicName = "tf-example-mnstopic",
Name = "tf-example-mnstopic-sub",
FilterTag = "test",
Endpoint = "http://www.xxx.com/xxx",
NotifyStrategy = "BACKOFF_RETRY",
NotifyContentFormat = "XML",
});
});
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 {
_, err := mns.NewTopic(ctx, "topic", &mns.TopicArgs{
Name: pulumi.String("tf-example-mnstopic"),
MaximumMessageSize: pulumi.Int(65536),
LoggingEnabled: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = mns.NewTopicSubscription(ctx, "subscription", &mns.TopicSubscriptionArgs{
TopicName: pulumi.String("tf-example-mnstopic"),
Name: pulumi.String("tf-example-mnstopic-sub"),
FilterTag: pulumi.String("test"),
Endpoint: pulumi.String("http://www.xxx.com/xxx"),
NotifyStrategy: pulumi.String("BACKOFF_RETRY"),
NotifyContentFormat: pulumi.String("XML"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.mns.Topic;
import com.pulumi.alicloud.mns.TopicArgs;
import com.pulumi.alicloud.mns.TopicSubscription;
import com.pulumi.alicloud.mns.TopicSubscriptionArgs;
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) {
var topic = new Topic("topic", TopicArgs.builder()
.name("tf-example-mnstopic")
.maximumMessageSize(65536)
.loggingEnabled(false)
.build());
var subscription = new TopicSubscription("subscription", TopicSubscriptionArgs.builder()
.topicName("tf-example-mnstopic")
.name("tf-example-mnstopic-sub")
.filterTag("test")
.endpoint("http://www.xxx.com/xxx")
.notifyStrategy("BACKOFF_RETRY")
.notifyContentFormat("XML")
.build());
}
}
resources:
topic:
type: alicloud:mns:Topic
properties:
name: tf-example-mnstopic
maximumMessageSize: 65536
loggingEnabled: false
subscription:
type: alicloud:mns:TopicSubscription
properties:
topicName: tf-example-mnstopic
name: tf-example-mnstopic-sub
filterTag: test
endpoint: http://www.xxx.com/xxx
notifyStrategy: BACKOFF_RETRY
notifyContentFormat: XML

Import

MNS Topic subscription can be imported using the id, e.g.

$ pulumi import alicloud:mns/topicSubscription:TopicSubscription subscription tf-example-mnstopic:tf-example-mnstopic-sub

Properties

Link copied to clipboard
val endpoint: Output<String>

The endpoint has three format. Available values format:

Link copied to clipboard
val filterTag: Output<String>?

The length should be shorter than 16.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Two topics subscription on a single account in the same topic cannot have the same name. A topic subscription 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.

Link copied to clipboard

The NotifyContentFormat attribute of Subscription. This attribute specifies the content format of the messages pushed to users. The valid values: SIMPLIFIED, XML and JSON. Default to SIMPLIFIED.

Link copied to clipboard
val notifyStrategy: Output<String>?

The NotifyStrategy attribute of Subscription. This attribute specifies the retry strategy when message sending fails. The Valid values: EXPONENTIAL_DECAY_RETRY and BACKOFF_RETRY. Default value to BACKOFF_RETRY .

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val topicName: Output<String>

The topic which The subscription belongs to was named with the 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.

Link copied to clipboard
val urn: Output<String>