tencentcloud.TrocketRocketmqTopic
Explore with Pulumi AI
Provides a resource to create a TROCKET rocketmq topic
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-6";
// create vpc
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
// create subnet
const subnet = new tencentcloud.Subnet("subnet", {
vpcId: vpc.vpcId,
availabilityZone: availabilityZone,
cidrBlock: "10.0.1.0/24",
isMulticast: false,
});
// create rocketmq instance
const exampleTrocketRocketmqInstance = new tencentcloud.TrocketRocketmqInstance("exampleTrocketRocketmqInstance", {
instanceType: "BASIC",
skuCode: "basic_2k",
remark: "remark.",
vpcId: vpc.vpcId,
subnetId: subnet.subnetId,
tags: {
tag_key: "createBy",
tag_value: "Terraform",
},
});
// create topic
const exampleTrocketRocketmqTopic = new tencentcloud.TrocketRocketmqTopic("exampleTrocketRocketmqTopic", {
instanceId: exampleTrocketRocketmqInstance.trocketRocketmqInstanceId,
topic: "tf-example",
topicType: "NORMAL",
queueNum: 4,
remark: "remark.",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
availability_zone = "ap-guangzhou-6"
# create vpc
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
# create subnet
subnet = tencentcloud.Subnet("subnet",
vpc_id=vpc.vpc_id,
availability_zone=availability_zone,
cidr_block="10.0.1.0/24",
is_multicast=False)
# create rocketmq instance
example_trocket_rocketmq_instance = tencentcloud.TrocketRocketmqInstance("exampleTrocketRocketmqInstance",
instance_type="BASIC",
sku_code="basic_2k",
remark="remark.",
vpc_id=vpc.vpc_id,
subnet_id=subnet.subnet_id,
tags={
"tag_key": "createBy",
"tag_value": "Terraform",
})
# create topic
example_trocket_rocketmq_topic = tencentcloud.TrocketRocketmqTopic("exampleTrocketRocketmqTopic",
instance_id=example_trocket_rocketmq_instance.trocket_rocketmq_instance_id,
topic="tf-example",
topic_type="NORMAL",
queue_num=4,
remark="remark.")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"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, "")
availabilityZone := "ap-guangzhou-6"
if param := cfg.Get("availabilityZone"); param != "" {
availabilityZone = param
}
// create vpc
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
})
if err != nil {
return err
}
// create subnet
subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
VpcId: vpc.VpcId,
AvailabilityZone: pulumi.String(availabilityZone),
CidrBlock: pulumi.String("10.0.1.0/24"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
// create rocketmq instance
exampleTrocketRocketmqInstance, err := tencentcloud.NewTrocketRocketmqInstance(ctx, "exampleTrocketRocketmqInstance", &tencentcloud.TrocketRocketmqInstanceArgs{
InstanceType: pulumi.String("BASIC"),
SkuCode: pulumi.String("basic_2k"),
Remark: pulumi.String("remark."),
VpcId: vpc.VpcId,
SubnetId: subnet.SubnetId,
Tags: pulumi.StringMap{
"tag_key": pulumi.String("createBy"),
"tag_value": pulumi.String("Terraform"),
},
})
if err != nil {
return err
}
// create topic
_, err = tencentcloud.NewTrocketRocketmqTopic(ctx, "exampleTrocketRocketmqTopic", &tencentcloud.TrocketRocketmqTopicArgs{
InstanceId: exampleTrocketRocketmqInstance.TrocketRocketmqInstanceId,
Topic: pulumi.String("tf-example"),
TopicType: pulumi.String("NORMAL"),
QueueNum: pulumi.Float64(4),
Remark: pulumi.String("remark."),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-6";
// create vpc
var vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
});
// create subnet
var subnet = new Tencentcloud.Subnet("subnet", new()
{
VpcId = vpc.VpcId,
AvailabilityZone = availabilityZone,
CidrBlock = "10.0.1.0/24",
IsMulticast = false,
});
// create rocketmq instance
var exampleTrocketRocketmqInstance = new Tencentcloud.TrocketRocketmqInstance("exampleTrocketRocketmqInstance", new()
{
InstanceType = "BASIC",
SkuCode = "basic_2k",
Remark = "remark.",
VpcId = vpc.VpcId,
SubnetId = subnet.SubnetId,
Tags =
{
{ "tag_key", "createBy" },
{ "tag_value", "Terraform" },
},
});
// create topic
var exampleTrocketRocketmqTopic = new Tencentcloud.TrocketRocketmqTopic("exampleTrocketRocketmqTopic", new()
{
InstanceId = exampleTrocketRocketmqInstance.TrocketRocketmqInstanceId,
Topic = "tf-example",
TopicType = "NORMAL",
QueueNum = 4,
Remark = "remark.",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.TrocketRocketmqInstance;
import com.pulumi.tencentcloud.TrocketRocketmqInstanceArgs;
import com.pulumi.tencentcloud.TrocketRocketmqTopic;
import com.pulumi.tencentcloud.TrocketRocketmqTopicArgs;
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 availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-6");
// create vpc
var vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
// create subnet
var subnet = new Subnet("subnet", SubnetArgs.builder()
.vpcId(vpc.vpcId())
.availabilityZone(availabilityZone)
.cidrBlock("10.0.1.0/24")
.isMulticast(false)
.build());
// create rocketmq instance
var exampleTrocketRocketmqInstance = new TrocketRocketmqInstance("exampleTrocketRocketmqInstance", TrocketRocketmqInstanceArgs.builder()
.instanceType("BASIC")
.skuCode("basic_2k")
.remark("remark.")
.vpcId(vpc.vpcId())
.subnetId(subnet.subnetId())
.tags(Map.ofEntries(
Map.entry("tag_key", "createBy"),
Map.entry("tag_value", "Terraform")
))
.build());
// create topic
var exampleTrocketRocketmqTopic = new TrocketRocketmqTopic("exampleTrocketRocketmqTopic", TrocketRocketmqTopicArgs.builder()
.instanceId(exampleTrocketRocketmqInstance.trocketRocketmqInstanceId())
.topic("tf-example")
.topicType("NORMAL")
.queueNum(4)
.remark("remark.")
.build());
}
}
configuration:
availabilityZone:
type: string
default: ap-guangzhou-6
resources:
# create vpc
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
# create subnet
subnet:
type: tencentcloud:Subnet
properties:
vpcId: ${vpc.vpcId}
availabilityZone: ${availabilityZone}
cidrBlock: 10.0.1.0/24
isMulticast: false
# create rocketmq instance
exampleTrocketRocketmqInstance:
type: tencentcloud:TrocketRocketmqInstance
properties:
instanceType: BASIC
skuCode: basic_2k
remark: remark.
vpcId: ${vpc.vpcId}
subnetId: ${subnet.subnetId}
tags:
tag_key: createBy
tag_value: Terraform
# create topic
exampleTrocketRocketmqTopic:
type: tencentcloud:TrocketRocketmqTopic
properties:
instanceId: ${exampleTrocketRocketmqInstance.trocketRocketmqInstanceId}
topic: tf-example
topicType: NORMAL
queueNum: 4
remark: remark.
Create TrocketRocketmqTopic Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TrocketRocketmqTopic(name: string, args: TrocketRocketmqTopicArgs, opts?: CustomResourceOptions);
@overload
def TrocketRocketmqTopic(resource_name: str,
args: TrocketRocketmqTopicArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TrocketRocketmqTopic(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
queue_num: Optional[float] = None,
topic: Optional[str] = None,
topic_type: Optional[str] = None,
remark: Optional[str] = None,
trocket_rocketmq_topic_id: Optional[str] = None)
func NewTrocketRocketmqTopic(ctx *Context, name string, args TrocketRocketmqTopicArgs, opts ...ResourceOption) (*TrocketRocketmqTopic, error)
public TrocketRocketmqTopic(string name, TrocketRocketmqTopicArgs args, CustomResourceOptions? opts = null)
public TrocketRocketmqTopic(String name, TrocketRocketmqTopicArgs args)
public TrocketRocketmqTopic(String name, TrocketRocketmqTopicArgs args, CustomResourceOptions options)
type: tencentcloud:TrocketRocketmqTopic
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 TrocketRocketmqTopicArgs
- 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 TrocketRocketmqTopicArgs
- 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 TrocketRocketmqTopicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TrocketRocketmqTopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TrocketRocketmqTopicArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TrocketRocketmqTopic Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The TrocketRocketmqTopic resource accepts the following input properties:
- Instance
Id string - Instance Id.
- Queue
Num double - Number of queue. Must be greater than or equal to 3.
- Topic string
- topic.
- Topic
Type string - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - Remark string
- remark.
- Trocket
Rocketmq stringTopic Id - ID of the resource.
- Instance
Id string - Instance Id.
- Queue
Num float64 - Number of queue. Must be greater than or equal to 3.
- Topic string
- topic.
- Topic
Type string - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - Remark string
- remark.
- Trocket
Rocketmq stringTopic Id - ID of the resource.
- instance
Id String - Instance Id.
- queue
Num Double - Number of queue. Must be greater than or equal to 3.
- topic String
- topic.
- topic
Type String - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - remark String
- remark.
- trocket
Rocketmq StringTopic Id - ID of the resource.
- instance
Id string - Instance Id.
- queue
Num number - Number of queue. Must be greater than or equal to 3.
- topic string
- topic.
- topic
Type string - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - remark string
- remark.
- trocket
Rocketmq stringTopic Id - ID of the resource.
- instance_
id str - Instance Id.
- queue_
num float - Number of queue. Must be greater than or equal to 3.
- topic str
- topic.
- topic_
type str - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - remark str
- remark.
- trocket_
rocketmq_ strtopic_ id - ID of the resource.
- instance
Id String - Instance Id.
- queue
Num Number - Number of queue. Must be greater than or equal to 3.
- topic String
- topic.
- topic
Type String - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - remark String
- remark.
- trocket
Rocketmq StringTopic Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the TrocketRocketmqTopic 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 TrocketRocketmqTopic Resource
Get an existing TrocketRocketmqTopic 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?: TrocketRocketmqTopicState, opts?: CustomResourceOptions): TrocketRocketmqTopic
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
queue_num: Optional[float] = None,
remark: Optional[str] = None,
topic: Optional[str] = None,
topic_type: Optional[str] = None,
trocket_rocketmq_topic_id: Optional[str] = None) -> TrocketRocketmqTopic
func GetTrocketRocketmqTopic(ctx *Context, name string, id IDInput, state *TrocketRocketmqTopicState, opts ...ResourceOption) (*TrocketRocketmqTopic, error)
public static TrocketRocketmqTopic Get(string name, Input<string> id, TrocketRocketmqTopicState? state, CustomResourceOptions? opts = null)
public static TrocketRocketmqTopic get(String name, Output<String> id, TrocketRocketmqTopicState state, CustomResourceOptions options)
resources: _: type: tencentcloud:TrocketRocketmqTopic get: id: ${id}
- 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.
- Instance
Id string - Instance Id.
- Queue
Num double - Number of queue. Must be greater than or equal to 3.
- Remark string
- remark.
- Topic string
- topic.
- Topic
Type string - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - Trocket
Rocketmq stringTopic Id - ID of the resource.
- Instance
Id string - Instance Id.
- Queue
Num float64 - Number of queue. Must be greater than or equal to 3.
- Remark string
- remark.
- Topic string
- topic.
- Topic
Type string - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - Trocket
Rocketmq stringTopic Id - ID of the resource.
- instance
Id String - Instance Id.
- queue
Num Double - Number of queue. Must be greater than or equal to 3.
- remark String
- remark.
- topic String
- topic.
- topic
Type String - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - trocket
Rocketmq StringTopic Id - ID of the resource.
- instance
Id string - Instance Id.
- queue
Num number - Number of queue. Must be greater than or equal to 3.
- remark string
- remark.
- topic string
- topic.
- topic
Type string - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - trocket
Rocketmq stringTopic Id - ID of the resource.
- instance_
id str - Instance Id.
- queue_
num float - Number of queue. Must be greater than or equal to 3.
- remark str
- remark.
- topic str
- topic.
- topic_
type str - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - trocket_
rocketmq_ strtopic_ id - ID of the resource.
- instance
Id String - Instance Id.
- queue
Num Number - Number of queue. Must be greater than or equal to 3.
- remark String
- remark.
- topic String
- topic.
- topic
Type String - Topic type.
UNSPECIFIED
: not specified,NORMAL
: normal message,FIFO
: sequential message,DELAY
: delayed message. - trocket
Rocketmq StringTopic Id - ID of the resource.
Import
TROCKET rocketmq topic can be imported using the id, e.g.
$ pulumi import tencentcloud:index/trocketRocketmqTopic:TrocketRocketmqTopic example rmq-1zj5vokgn#tf-example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.