Topic Subscription Args
data class TopicSubscriptionArgs(val endpoint: Output<String>? = null, val filterTag: Output<String>? = null, val name: Output<String>? = null, val notifyContentFormat: Output<String>? = null, val notifyStrategy: Output<String>? = null, val topicName: Output<String>? = null) : ConvertibleToJava<TopicSubscriptionArgs>
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",
});
Content copied to clipboard
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")
Content copied to clipboard
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
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
Content copied to clipboard
Constructors
Properties
Link copied to clipboard
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
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
.