IotTopicPublishProperty Struct
Information required to publish the MQTT message through the AWS IoT message broker.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iotevents as iotevents } from 'aws-cdk-lib';
const iotTopicPublishProperty: iotevents.CfnAlarmModel.IotTopicPublishProperty = {
mqttTopic: 'mqttTopic',
// the properties below are optional
payload: {
contentExpression: 'contentExpression',
type: 'type',
},
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iotevents as iotevents
iot_topic_publish_property = iotevents.CfnAlarmModel.IotTopicPublishProperty(
mqtt_topic="mqttTopic",
# the properties below are optional
payload=iotevents.CfnAlarmModel.PayloadProperty(
content_expression="contentExpression",
type="type"
)
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iotevents.*;
IotTopicPublishProperty iotTopicPublishProperty = IotTopicPublishProperty.builder()
.mqttTopic("mqttTopic")
// the properties below are optional
.payload(PayloadProperty.builder()
.contentExpression("contentExpression")
.type("type")
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IoTEvents;
var iotTopicPublishProperty = new IotTopicPublishProperty {
MqttTopic = "mqttTopic",
// the properties below are optional
Payload = new PayloadProperty {
ContentExpression = "contentExpression",
Type = "type"
}
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
iotTopicPublishProperty := &IotTopicPublishProperty{
MqttTopic: jsii.String("mqttTopic"),
// the properties below are optional
Payload: &PayloadProperty{
ContentExpression: jsii.String("contentExpression"),
Type: jsii.String("type"),
},
}
Properties
The MQTT topic of the message.
You can use a string expression that includes variables ( $variable.<variable-name> ) and input values ( $input.<input-name>.<path-to-datum> ) as the topic string.
payloadoptionalIResolvable | CfnAlarmModel.PayloadPropertypayloadoptionaltyping.Union[IResolvable, PayloadProperty]payloadoptionalIResolvablePayloadoptionalIResolvablePayloadoptionalinterface{}#You can configure the action payload when you publish a message to an AWS IoT Core topic.