1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. MqttMessageEnrichmentRule
tencentcloud 1.82.68 published on Friday, Feb 6, 2026 by tencentcloudstack
tencentcloud logo
tencentcloud 1.82.68 published on Friday, Feb 6, 2026 by tencentcloudstack

    Provides a resource to create a MQTT message enrichment rule

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.MqttMessageEnrichmentRule("example", {
        instanceId: "mqtt-zxje8zdd",
        ruleName: "tf-example",
        condition: {
            username: "user*",
            clientId: "clientDemo",
            topic: "topicDemo",
        },
        actions: {
            messageExpiryInterval: 3600,
            responseTopic: "topicDemo",
            correlationData: "correlationData",
            userProperties: [{
                key: "key",
                value: "value",
            }],
        },
        priority: 10,
        status: 1,
        remark: "remark.",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.MqttMessageEnrichmentRule("example",
        instance_id="mqtt-zxje8zdd",
        rule_name="tf-example",
        condition={
            "username": "user*",
            "client_id": "clientDemo",
            "topic": "topicDemo",
        },
        actions={
            "message_expiry_interval": 3600,
            "response_topic": "topicDemo",
            "correlation_data": "correlationData",
            "user_properties": [{
                "key": "key",
                "value": "value",
            }],
        },
        priority=10,
        status=1,
        remark="remark.")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewMqttMessageEnrichmentRule(ctx, "example", &tencentcloud.MqttMessageEnrichmentRuleArgs{
    			InstanceId: pulumi.String("mqtt-zxje8zdd"),
    			RuleName:   pulumi.String("tf-example"),
    			Condition: &tencentcloud.MqttMessageEnrichmentRuleConditionArgs{
    				Username: pulumi.String("user*"),
    				ClientId: pulumi.String("clientDemo"),
    				Topic:    pulumi.String("topicDemo"),
    			},
    			Actions: &tencentcloud.MqttMessageEnrichmentRuleActionsArgs{
    				MessageExpiryInterval: pulumi.Float64(3600),
    				ResponseTopic:         pulumi.String("topicDemo"),
    				CorrelationData:       pulumi.String("correlationData"),
    				UserProperties: tencentcloud.MqttMessageEnrichmentRuleActionsUserPropertyArray{
    					&tencentcloud.MqttMessageEnrichmentRuleActionsUserPropertyArgs{
    						Key:   pulumi.String("key"),
    						Value: pulumi.String("value"),
    					},
    				},
    			},
    			Priority: pulumi.Float64(10),
    			Status:   pulumi.Float64(1),
    			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 example = new Tencentcloud.MqttMessageEnrichmentRule("example", new()
        {
            InstanceId = "mqtt-zxje8zdd",
            RuleName = "tf-example",
            Condition = new Tencentcloud.Inputs.MqttMessageEnrichmentRuleConditionArgs
            {
                Username = "user*",
                ClientId = "clientDemo",
                Topic = "topicDemo",
            },
            Actions = new Tencentcloud.Inputs.MqttMessageEnrichmentRuleActionsArgs
            {
                MessageExpiryInterval = 3600,
                ResponseTopic = "topicDemo",
                CorrelationData = "correlationData",
                UserProperties = new[]
                {
                    new Tencentcloud.Inputs.MqttMessageEnrichmentRuleActionsUserPropertyArgs
                    {
                        Key = "key",
                        Value = "value",
                    },
                },
            },
            Priority = 10,
            Status = 1,
            Remark = "remark.",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.MqttMessageEnrichmentRule;
    import com.pulumi.tencentcloud.MqttMessageEnrichmentRuleArgs;
    import com.pulumi.tencentcloud.inputs.MqttMessageEnrichmentRuleConditionArgs;
    import com.pulumi.tencentcloud.inputs.MqttMessageEnrichmentRuleActionsArgs;
    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 example = new MqttMessageEnrichmentRule("example", MqttMessageEnrichmentRuleArgs.builder()
                .instanceId("mqtt-zxje8zdd")
                .ruleName("tf-example")
                .condition(MqttMessageEnrichmentRuleConditionArgs.builder()
                    .username("user*")
                    .clientId("clientDemo")
                    .topic("topicDemo")
                    .build())
                .actions(MqttMessageEnrichmentRuleActionsArgs.builder()
                    .messageExpiryInterval(3600.0)
                    .responseTopic("topicDemo")
                    .correlationData("correlationData")
                    .userProperties(MqttMessageEnrichmentRuleActionsUserPropertyArgs.builder()
                        .key("key")
                        .value("value")
                        .build())
                    .build())
                .priority(10.0)
                .status(1.0)
                .remark("remark.")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:MqttMessageEnrichmentRule
        properties:
          instanceId: mqtt-zxje8zdd
          ruleName: tf-example
          condition:
            username: user*
            clientId: clientDemo
            topic: topicDemo
          actions:
            messageExpiryInterval: 3600
            responseTopic: topicDemo
            correlationData: correlationData
            userProperties:
              - key: key
                value: value
          priority: 10
          status: 1
          remark: remark.
    

    Create MqttMessageEnrichmentRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MqttMessageEnrichmentRule(name: string, args: MqttMessageEnrichmentRuleArgs, opts?: CustomResourceOptions);
    @overload
    def MqttMessageEnrichmentRule(resource_name: str,
                                  args: MqttMessageEnrichmentRuleArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def MqttMessageEnrichmentRule(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  actions: Optional[MqttMessageEnrichmentRuleActionsArgs] = None,
                                  condition: Optional[MqttMessageEnrichmentRuleConditionArgs] = None,
                                  instance_id: Optional[str] = None,
                                  priority: Optional[float] = None,
                                  rule_name: Optional[str] = None,
                                  mqtt_message_enrichment_rule_id: Optional[str] = None,
                                  remark: Optional[str] = None,
                                  status: Optional[float] = None)
    func NewMqttMessageEnrichmentRule(ctx *Context, name string, args MqttMessageEnrichmentRuleArgs, opts ...ResourceOption) (*MqttMessageEnrichmentRule, error)
    public MqttMessageEnrichmentRule(string name, MqttMessageEnrichmentRuleArgs args, CustomResourceOptions? opts = null)
    public MqttMessageEnrichmentRule(String name, MqttMessageEnrichmentRuleArgs args)
    public MqttMessageEnrichmentRule(String name, MqttMessageEnrichmentRuleArgs args, CustomResourceOptions options)
    
    type: tencentcloud:MqttMessageEnrichmentRule
    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 MqttMessageEnrichmentRuleArgs
    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 MqttMessageEnrichmentRuleArgs
    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 MqttMessageEnrichmentRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MqttMessageEnrichmentRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MqttMessageEnrichmentRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    MqttMessageEnrichmentRule 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 MqttMessageEnrichmentRule resource accepts the following input properties:

    Actions MqttMessageEnrichmentRuleActions
    Rule execution actions.
    Condition MqttMessageEnrichmentRuleCondition
    Rule matching condition.
    InstanceId string
    MQTT instance ID.
    Priority double
    Rule priority, smaller number means higher priority.
    RuleName string
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    MqttMessageEnrichmentRuleId string
    ID of the resource.
    Remark string
    Remark information. not exceeding 128 characters in length.
    Status double
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    Actions MqttMessageEnrichmentRuleActionsArgs
    Rule execution actions.
    Condition MqttMessageEnrichmentRuleConditionArgs
    Rule matching condition.
    InstanceId string
    MQTT instance ID.
    Priority float64
    Rule priority, smaller number means higher priority.
    RuleName string
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    MqttMessageEnrichmentRuleId string
    ID of the resource.
    Remark string
    Remark information. not exceeding 128 characters in length.
    Status float64
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    actions MqttMessageEnrichmentRuleActions
    Rule execution actions.
    condition MqttMessageEnrichmentRuleCondition
    Rule matching condition.
    instanceId String
    MQTT instance ID.
    priority Double
    Rule priority, smaller number means higher priority.
    ruleName String
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    mqttMessageEnrichmentRuleId String
    ID of the resource.
    remark String
    Remark information. not exceeding 128 characters in length.
    status Double
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    actions MqttMessageEnrichmentRuleActions
    Rule execution actions.
    condition MqttMessageEnrichmentRuleCondition
    Rule matching condition.
    instanceId string
    MQTT instance ID.
    priority number
    Rule priority, smaller number means higher priority.
    ruleName string
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    mqttMessageEnrichmentRuleId string
    ID of the resource.
    remark string
    Remark information. not exceeding 128 characters in length.
    status number
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    actions MqttMessageEnrichmentRuleActionsArgs
    Rule execution actions.
    condition MqttMessageEnrichmentRuleConditionArgs
    Rule matching condition.
    instance_id str
    MQTT instance ID.
    priority float
    Rule priority, smaller number means higher priority.
    rule_name str
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    mqtt_message_enrichment_rule_id str
    ID of the resource.
    remark str
    Remark information. not exceeding 128 characters in length.
    status float
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    actions Property Map
    Rule execution actions.
    condition Property Map
    Rule matching condition.
    instanceId String
    MQTT instance ID.
    priority Number
    Rule priority, smaller number means higher priority.
    ruleName String
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    mqttMessageEnrichmentRuleId String
    ID of the resource.
    remark String
    Remark information. not exceeding 128 characters in length.
    status Number
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MqttMessageEnrichmentRule resource produces the following output properties:

    CreateTime string
    Create time, millisecond timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId double
    Rule ID.
    UpdateTime string
    Update time, millisecond timestamp.
    CreateTime string
    Create time, millisecond timestamp.
    Id string
    The provider-assigned unique ID for this managed resource.
    RuleId float64
    Rule ID.
    UpdateTime string
    Update time, millisecond timestamp.
    createTime String
    Create time, millisecond timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId Double
    Rule ID.
    updateTime String
    Update time, millisecond timestamp.
    createTime string
    Create time, millisecond timestamp.
    id string
    The provider-assigned unique ID for this managed resource.
    ruleId number
    Rule ID.
    updateTime string
    Update time, millisecond timestamp.
    create_time str
    Create time, millisecond timestamp.
    id str
    The provider-assigned unique ID for this managed resource.
    rule_id float
    Rule ID.
    update_time str
    Update time, millisecond timestamp.
    createTime String
    Create time, millisecond timestamp.
    id String
    The provider-assigned unique ID for this managed resource.
    ruleId Number
    Rule ID.
    updateTime String
    Update time, millisecond timestamp.

    Look up Existing MqttMessageEnrichmentRule Resource

    Get an existing MqttMessageEnrichmentRule 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?: MqttMessageEnrichmentRuleState, opts?: CustomResourceOptions): MqttMessageEnrichmentRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            actions: Optional[MqttMessageEnrichmentRuleActionsArgs] = None,
            condition: Optional[MqttMessageEnrichmentRuleConditionArgs] = None,
            create_time: Optional[str] = None,
            instance_id: Optional[str] = None,
            mqtt_message_enrichment_rule_id: Optional[str] = None,
            priority: Optional[float] = None,
            remark: Optional[str] = None,
            rule_id: Optional[float] = None,
            rule_name: Optional[str] = None,
            status: Optional[float] = None,
            update_time: Optional[str] = None) -> MqttMessageEnrichmentRule
    func GetMqttMessageEnrichmentRule(ctx *Context, name string, id IDInput, state *MqttMessageEnrichmentRuleState, opts ...ResourceOption) (*MqttMessageEnrichmentRule, error)
    public static MqttMessageEnrichmentRule Get(string name, Input<string> id, MqttMessageEnrichmentRuleState? state, CustomResourceOptions? opts = null)
    public static MqttMessageEnrichmentRule get(String name, Output<String> id, MqttMessageEnrichmentRuleState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:MqttMessageEnrichmentRule    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.
    The following state arguments are supported:
    Actions MqttMessageEnrichmentRuleActions
    Rule execution actions.
    Condition MqttMessageEnrichmentRuleCondition
    Rule matching condition.
    CreateTime string
    Create time, millisecond timestamp.
    InstanceId string
    MQTT instance ID.
    MqttMessageEnrichmentRuleId string
    ID of the resource.
    Priority double
    Rule priority, smaller number means higher priority.
    Remark string
    Remark information. not exceeding 128 characters in length.
    RuleId double
    Rule ID.
    RuleName string
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    Status double
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    UpdateTime string
    Update time, millisecond timestamp.
    Actions MqttMessageEnrichmentRuleActionsArgs
    Rule execution actions.
    Condition MqttMessageEnrichmentRuleConditionArgs
    Rule matching condition.
    CreateTime string
    Create time, millisecond timestamp.
    InstanceId string
    MQTT instance ID.
    MqttMessageEnrichmentRuleId string
    ID of the resource.
    Priority float64
    Rule priority, smaller number means higher priority.
    Remark string
    Remark information. not exceeding 128 characters in length.
    RuleId float64
    Rule ID.
    RuleName string
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    Status float64
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    UpdateTime string
    Update time, millisecond timestamp.
    actions MqttMessageEnrichmentRuleActions
    Rule execution actions.
    condition MqttMessageEnrichmentRuleCondition
    Rule matching condition.
    createTime String
    Create time, millisecond timestamp.
    instanceId String
    MQTT instance ID.
    mqttMessageEnrichmentRuleId String
    ID of the resource.
    priority Double
    Rule priority, smaller number means higher priority.
    remark String
    Remark information. not exceeding 128 characters in length.
    ruleId Double
    Rule ID.
    ruleName String
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    status Double
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    updateTime String
    Update time, millisecond timestamp.
    actions MqttMessageEnrichmentRuleActions
    Rule execution actions.
    condition MqttMessageEnrichmentRuleCondition
    Rule matching condition.
    createTime string
    Create time, millisecond timestamp.
    instanceId string
    MQTT instance ID.
    mqttMessageEnrichmentRuleId string
    ID of the resource.
    priority number
    Rule priority, smaller number means higher priority.
    remark string
    Remark information. not exceeding 128 characters in length.
    ruleId number
    Rule ID.
    ruleName string
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    status number
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    updateTime string
    Update time, millisecond timestamp.
    actions MqttMessageEnrichmentRuleActionsArgs
    Rule execution actions.
    condition MqttMessageEnrichmentRuleConditionArgs
    Rule matching condition.
    create_time str
    Create time, millisecond timestamp.
    instance_id str
    MQTT instance ID.
    mqtt_message_enrichment_rule_id str
    ID of the resource.
    priority float
    Rule priority, smaller number means higher priority.
    remark str
    Remark information. not exceeding 128 characters in length.
    rule_id float
    Rule ID.
    rule_name str
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    status float
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    update_time str
    Update time, millisecond timestamp.
    actions Property Map
    Rule execution actions.
    condition Property Map
    Rule matching condition.
    createTime String
    Create time, millisecond timestamp.
    instanceId String
    MQTT instance ID.
    mqttMessageEnrichmentRuleId String
    ID of the resource.
    priority Number
    Rule priority, smaller number means higher priority.
    remark String
    Remark information. not exceeding 128 characters in length.
    ruleId Number
    Rule ID.
    ruleName String
    Rule name, 3-64 characters, supports Chinese, letters, numbers, - and _.
    status Number
    Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
    updateTime String
    Update time, millisecond timestamp.

    Supporting Types

    MqttMessageEnrichmentRuleActions, MqttMessageEnrichmentRuleActionsArgs

    CorrelationData string
    Correlation Data.
    MessageExpiryInterval double
    Message expiration interval.
    ResponseTopic string
    Response Topic.
    UserProperties List<MqttMessageEnrichmentRuleActionsUserProperty>
    User Properties.
    CorrelationData string
    Correlation Data.
    MessageExpiryInterval float64
    Message expiration interval.
    ResponseTopic string
    Response Topic.
    UserProperties []MqttMessageEnrichmentRuleActionsUserProperty
    User Properties.
    correlationData String
    Correlation Data.
    messageExpiryInterval Double
    Message expiration interval.
    responseTopic String
    Response Topic.
    userProperties List<MqttMessageEnrichmentRuleActionsUserProperty>
    User Properties.
    correlationData string
    Correlation Data.
    messageExpiryInterval number
    Message expiration interval.
    responseTopic string
    Response Topic.
    userProperties MqttMessageEnrichmentRuleActionsUserProperty[]
    User Properties.
    correlation_data str
    Correlation Data.
    message_expiry_interval float
    Message expiration interval.
    response_topic str
    Response Topic.
    user_properties Sequence[MqttMessageEnrichmentRuleActionsUserProperty]
    User Properties.
    correlationData String
    Correlation Data.
    messageExpiryInterval Number
    Message expiration interval.
    responseTopic String
    Response Topic.
    userProperties List<Property Map>
    User Properties.

    MqttMessageEnrichmentRuleActionsUserProperty, MqttMessageEnrichmentRuleActionsUserPropertyArgs

    Key string
    Key.
    Value string
    Value.
    Key string
    Key.
    Value string
    Value.
    key String
    Key.
    value String
    Value.
    key string
    Key.
    value string
    Value.
    key str
    Key.
    value str
    Value.
    key String
    Key.
    value String
    Value.

    MqttMessageEnrichmentRuleCondition, MqttMessageEnrichmentRuleConditionArgs

    ClientId string
    Client ID.
    Topic string
    Topic.
    Username string
    User name.
    ClientId string
    Client ID.
    Topic string
    Topic.
    Username string
    User name.
    clientId String
    Client ID.
    topic String
    Topic.
    username String
    User name.
    clientId string
    Client ID.
    topic string
    Topic.
    username string
    User name.
    client_id str
    Client ID.
    topic str
    Topic.
    username str
    User name.
    clientId String
    Client ID.
    topic String
    Topic.
    username String
    User name.

    Import

    MQTT message enrichment rule can be imported using the instanceId#ruleId, e.g.

    $ pulumi import tencentcloud:index/mqttMessageEnrichmentRule:MqttMessageEnrichmentRule example mqtt-zxje8zdd#34
    

    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.
    tencentcloud logo
    tencentcloud 1.82.68 published on Friday, Feb 6, 2026 by tencentcloudstack
      Meet Neo: Your AI Platform Teammate