alicloud.message.ServiceTopic
Explore with Pulumi AI
Provides a Message Notification Service Topic resource.
For information about Message Notification 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") || "tf-example";
const _default = new alicloud.message.ServiceTopic("default", {
topicName: name,
maxMessageSize: 12357,
loggingEnabled: true,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.message.ServiceTopic("default",
topic_name=name,
max_message_size=12357,
logging_enabled=True)
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 := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := message.NewServiceTopic(ctx, "default", &message.ServiceTopicArgs{
TopicName: pulumi.String(name),
MaxMessageSize: pulumi.Int(12357),
LoggingEnabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
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") ?? "tf-example";
var @default = new AliCloud.Message.ServiceTopic("default", new()
{
TopicName = name,
MaxMessageSize = 12357,
LoggingEnabled = true,
});
});
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("tf-example");
var default_ = new ServiceTopic("default", ServiceTopicArgs.builder()
.topicName(name)
.maxMessageSize(12357)
.loggingEnabled(true)
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
default:
type: alicloud:message:ServiceTopic
properties:
topicName: ${name}
maxMessageSize: 12357
loggingEnabled: true
Create ServiceTopic Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceTopic(name: string, args: ServiceTopicArgs, opts?: CustomResourceOptions);
@overload
def ServiceTopic(resource_name: str,
args: ServiceTopicArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceTopic(resource_name: str,
opts: Optional[ResourceOptions] = None,
topic_name: Optional[str] = None,
logging_enabled: Optional[bool] = None,
max_message_size: Optional[int] = None)
func NewServiceTopic(ctx *Context, name string, args ServiceTopicArgs, opts ...ResourceOption) (*ServiceTopic, error)
public ServiceTopic(string name, ServiceTopicArgs args, CustomResourceOptions? opts = null)
public ServiceTopic(String name, ServiceTopicArgs args)
public ServiceTopic(String name, ServiceTopicArgs args, CustomResourceOptions options)
type: alicloud:message:ServiceTopic
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ServiceTopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServiceTopicArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServiceTopicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceTopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceTopicArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var serviceTopicResource = new AliCloud.Message.ServiceTopic("serviceTopicResource", new()
{
TopicName = "string",
LoggingEnabled = false,
MaxMessageSize = 0,
});
example, err := message.NewServiceTopic(ctx, "serviceTopicResource", &message.ServiceTopicArgs{
TopicName: pulumi.String("string"),
LoggingEnabled: pulumi.Bool(false),
MaxMessageSize: pulumi.Int(0),
})
var serviceTopicResource = new ServiceTopic("serviceTopicResource", ServiceTopicArgs.builder()
.topicName("string")
.loggingEnabled(false)
.maxMessageSize(0)
.build());
service_topic_resource = alicloud.message.ServiceTopic("serviceTopicResource",
topic_name="string",
logging_enabled=False,
max_message_size=0)
const serviceTopicResource = new alicloud.message.ServiceTopic("serviceTopicResource", {
topicName: "string",
loggingEnabled: false,
maxMessageSize: 0,
});
type: alicloud:message:ServiceTopic
properties:
loggingEnabled: false
maxMessageSize: 0
topicName: string
ServiceTopic Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ServiceTopic resource accepts the following input properties:
- 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 255 characters.
- Logging
Enabled bool - Specifies whether to enable the log management feature. Default value: false. Valid values:
- Max
Message intSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- Logging
Enabled bool - Specifies whether to enable the log management feature. Default value: false. Valid values:
- Max
Message intSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging
Enabled Boolean - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max
Message IntegerSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging
Enabled boolean - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max
Message numberSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging_
enabled bool - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max_
message_ intsize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging
Enabled Boolean - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max
Message NumberSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceTopic resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ServiceTopic Resource
Get an existing ServiceTopic resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ServiceTopicState, opts?: CustomResourceOptions): ServiceTopic
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
logging_enabled: Optional[bool] = None,
max_message_size: Optional[int] = None,
topic_name: Optional[str] = None) -> ServiceTopic
func GetServiceTopic(ctx *Context, name string, id IDInput, state *ServiceTopicState, opts ...ResourceOption) (*ServiceTopic, error)
public static ServiceTopic Get(string name, Input<string> id, ServiceTopicState? state, CustomResourceOptions? opts = null)
public static ServiceTopic get(String name, Output<String> id, ServiceTopicState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Logging
Enabled bool - Specifies whether to enable the log management feature. Default value: false. Valid values:
- Max
Message intSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- Logging
Enabled bool - Specifies whether to enable the log management feature. Default value: false. Valid values:
- Max
Message intSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging
Enabled Boolean - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max
Message IntegerSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging
Enabled boolean - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max
Message numberSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging_
enabled bool - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max_
message_ intsize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
- logging
Enabled Boolean - Specifies whether to enable the log management feature. Default value: false. Valid values:
- max
Message NumberSize - The maximum size of a message body that can be sent to the topic. Unit: bytes. Valid values: 1024-65536. Default value: 65536.
- 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 255 characters.
Import
Message Notification Service Topic can be imported using the id or topic_name, e.g.
$ pulumi import alicloud:message/serviceTopic:ServiceTopic example <topic_name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.