Service Topic
Provides a Message Service Topic resource. For information about Message Service Topic and how to use it, see What is Topic.
NOTE: Available since v1.188.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.message.ServiceTopic("default", {
topicName: name,
maxMessageSize: 16888,
enableLogging: true,
});
Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.message.ServiceTopic("default",
topic_name=name,
max_message_size=16888,
enable_logging=True)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.Message.ServiceTopic("default", new()
{
TopicName = name,
MaxMessageSize = 16888,
EnableLogging = true,
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/message"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := message.NewServiceTopic(ctx, "default", &message.ServiceTopicArgs{
TopicName: pulumi.String(name),
MaxMessageSize: pulumi.Int(16888),
EnableLogging: pulumi.Bool(true),
})
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.message.ServiceTopic;
import com.pulumi.alicloud.message.ServiceTopicArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new ServiceTopic("default", ServiceTopicArgs.builder()
.topicName(name)
.maxMessageSize(16888)
.enableLogging(true)
.build());
}
}
Content copied to clipboard
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:message:ServiceTopic
properties:
topicName: ${name}
maxMessageSize: 16888
enableLogging: true
Content copied to clipboard
Import
Message Service Topic can be imported using the id, e.g.
$ pulumi import alicloud:message/serviceTopic:ServiceTopic example <id>
Content copied to clipboard
Properties
Link copied to clipboard
(Available since v1.241.0) The time when the topic was created.
Link copied to clipboard
Specifies whether to enable the logging feature. Default value: false
. Valid values:
Link copied to clipboard
. Field logging_enabled
has been deprecated from provider version 1.241.0. New field enable_logging
instead.
Link copied to clipboard
The maximum length of the message that is sent to the topic. Default value: 65536
. Valid values: 1024
to 65536
. Unit: bytes.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard