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
Mqtt
Message Enrichment Rule Actions - Rule execution actions.
- Condition
Mqtt
Message Enrichment Rule Condition - Rule matching condition.
- Instance
Id string - MQTT instance ID.
- Priority double
- Rule priority, smaller number means higher priority.
- Rule
Name string - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - Mqtt
Message stringEnrichment Rule Id - 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
Mqtt
Message Enrichment Rule Actions Args - Rule execution actions.
- Condition
Mqtt
Message Enrichment Rule Condition Args - Rule matching condition.
- Instance
Id string - MQTT instance ID.
- Priority float64
- Rule priority, smaller number means higher priority.
- Rule
Name string - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - Mqtt
Message stringEnrichment Rule Id - 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
Mqtt
Message Enrichment Rule Actions - Rule execution actions.
- condition
Mqtt
Message Enrichment Rule Condition - Rule matching condition.
- instance
Id String - MQTT instance ID.
- priority Double
- Rule priority, smaller number means higher priority.
- rule
Name String - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - mqtt
Message StringEnrichment Rule Id - 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
Mqtt
Message Enrichment Rule Actions - Rule execution actions.
- condition
Mqtt
Message Enrichment Rule Condition - Rule matching condition.
- instance
Id string - MQTT instance ID.
- priority number
- Rule priority, smaller number means higher priority.
- rule
Name string - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - mqtt
Message stringEnrichment Rule Id - 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
Mqtt
Message Enrichment Rule Actions Args - Rule execution actions.
- condition
Mqtt
Message Enrichment Rule Condition Args - 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_ strenrichment_ rule_ id - 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.
- instance
Id String - MQTT instance ID.
- priority Number
- Rule priority, smaller number means higher priority.
- rule
Name String - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - mqtt
Message StringEnrichment Rule Id - 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:
- Create
Time string - Create time, millisecond timestamp.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Id double - Rule ID.
- Update
Time string - Update time, millisecond timestamp.
- Create
Time string - Create time, millisecond timestamp.
- Id string
- The provider-assigned unique ID for this managed resource.
- Rule
Id float64 - Rule ID.
- Update
Time string - Update time, millisecond timestamp.
- create
Time String - Create time, millisecond timestamp.
- id String
- The provider-assigned unique ID for this managed resource.
- rule
Id Double - Rule ID.
- update
Time String - Update time, millisecond timestamp.
- create
Time string - Create time, millisecond timestamp.
- id string
- The provider-assigned unique ID for this managed resource.
- rule
Id number - Rule ID.
- update
Time 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.
- create
Time String - Create time, millisecond timestamp.
- id String
- The provider-assigned unique ID for this managed resource.
- rule
Id Number - Rule ID.
- update
Time 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) -> MqttMessageEnrichmentRulefunc 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.
- Actions
Mqtt
Message Enrichment Rule Actions - Rule execution actions.
- Condition
Mqtt
Message Enrichment Rule Condition - Rule matching condition.
- Create
Time string - Create time, millisecond timestamp.
- Instance
Id string - MQTT instance ID.
- Mqtt
Message stringEnrichment Rule Id - ID of the resource.
- Priority double
- Rule priority, smaller number means higher priority.
- Remark string
- Remark information. not exceeding 128 characters in length.
- Rule
Id double - Rule ID.
- Rule
Name string - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - Status double
- Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
- Update
Time string - Update time, millisecond timestamp.
- Actions
Mqtt
Message Enrichment Rule Actions Args - Rule execution actions.
- Condition
Mqtt
Message Enrichment Rule Condition Args - Rule matching condition.
- Create
Time string - Create time, millisecond timestamp.
- Instance
Id string - MQTT instance ID.
- Mqtt
Message stringEnrichment Rule Id - ID of the resource.
- Priority float64
- Rule priority, smaller number means higher priority.
- Remark string
- Remark information. not exceeding 128 characters in length.
- Rule
Id float64 - Rule ID.
- Rule
Name string - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - Status float64
- Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
- Update
Time string - Update time, millisecond timestamp.
- actions
Mqtt
Message Enrichment Rule Actions - Rule execution actions.
- condition
Mqtt
Message Enrichment Rule Condition - Rule matching condition.
- create
Time String - Create time, millisecond timestamp.
- instance
Id String - MQTT instance ID.
- mqtt
Message StringEnrichment Rule Id - ID of the resource.
- priority Double
- Rule priority, smaller number means higher priority.
- remark String
- Remark information. not exceeding 128 characters in length.
- rule
Id Double - Rule ID.
- rule
Name String - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - status Double
- Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
- update
Time String - Update time, millisecond timestamp.
- actions
Mqtt
Message Enrichment Rule Actions - Rule execution actions.
- condition
Mqtt
Message Enrichment Rule Condition - Rule matching condition.
- create
Time string - Create time, millisecond timestamp.
- instance
Id string - MQTT instance ID.
- mqtt
Message stringEnrichment Rule Id - ID of the resource.
- priority number
- Rule priority, smaller number means higher priority.
- remark string
- Remark information. not exceeding 128 characters in length.
- rule
Id number - Rule ID.
- rule
Name string - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - status number
- Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
- update
Time string - Update time, millisecond timestamp.
- actions
Mqtt
Message Enrichment Rule Actions Args - Rule execution actions.
- condition
Mqtt
Message Enrichment Rule Condition Args - Rule matching condition.
- create_
time str - Create time, millisecond timestamp.
- instance_
id str - MQTT instance ID.
- mqtt_
message_ strenrichment_ rule_ id - 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.
- create
Time String - Create time, millisecond timestamp.
- instance
Id String - MQTT instance ID.
- mqtt
Message StringEnrichment Rule Id - ID of the resource.
- priority Number
- Rule priority, smaller number means higher priority.
- remark String
- Remark information. not exceeding 128 characters in length.
- rule
Id Number - Rule ID.
- rule
Name String - Rule name, 3-64 characters, supports Chinese, letters, numbers,
-and_. - status Number
- Policy status, 0: undefined; 1: active; 2: inactive, default is 2.
- update
Time String - Update time, millisecond timestamp.
Supporting Types
MqttMessageEnrichmentRuleActions, MqttMessageEnrichmentRuleActionsArgs
- Correlation
Data string - Correlation Data.
- Message
Expiry doubleInterval - Message expiration interval.
- Response
Topic string - Response Topic.
- User
Properties List<MqttMessage Enrichment Rule Actions User Property> - User Properties.
- Correlation
Data string - Correlation Data.
- Message
Expiry float64Interval - Message expiration interval.
- Response
Topic string - Response Topic.
- User
Properties []MqttMessage Enrichment Rule Actions User Property - User Properties.
- correlation
Data String - Correlation Data.
- message
Expiry DoubleInterval - Message expiration interval.
- response
Topic String - Response Topic.
- user
Properties List<MqttMessage Enrichment Rule Actions User Property> - User Properties.
- correlation
Data string - Correlation Data.
- message
Expiry numberInterval - Message expiration interval.
- response
Topic string - Response Topic.
- user
Properties MqttMessage Enrichment Rule Actions User Property[] - User Properties.
- correlation_
data str - Correlation Data.
- message_
expiry_ floatinterval - Message expiration interval.
- response_
topic str - Response Topic.
- user_
properties Sequence[MqttMessage Enrichment Rule Actions User Property] - User Properties.
- correlation
Data String - Correlation Data.
- message
Expiry NumberInterval - Message expiration interval.
- response
Topic String - Response Topic.
- user
Properties List<Property Map> - User Properties.
MqttMessageEnrichmentRuleActionsUserProperty, MqttMessageEnrichmentRuleActionsUserPropertyArgs
MqttMessageEnrichmentRuleCondition, MqttMessageEnrichmentRuleConditionArgs
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
tencentcloudTerraform Provider.
