@aws-cdk_aws-iot-actions-alpha.SnsActionMessageFormat

enum SnsActionMessageFormat ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.IoT.Actions.Alpha.SnsActionMessageFormat
Gogithub.com/aws/aws-cdk-go/awscdkiotactionsalpha/v2#SnsActionMessageFormat
Javasoftware.amazon.awscdk.services.iot.actions.alpha.SnsActionMessageFormat
Pythonaws_cdk.aws_iot_actions_alpha.SnsActionMessageFormat
TypeScript (source)@aws-cdk/aws-iot-actions-alpha ยป SnsActionMessageFormat

SNS topic action message format options.

Example

import * as sns from 'aws-cdk-lib/aws-sns';

const topic = new sns.Topic(this, 'MyTopic');

const topicRule = new iot.TopicRule(this, 'TopicRule', {
  sql: iot.IotSql.fromStringAsVer20160323(
    "SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'",
  ),
  actions: [
    new actions.SnsTopicAction(topic, {
      messageFormat: actions.SnsActionMessageFormat.JSON, // optional property, default is SnsActionMessageFormat.RAW
    }),
  ],
});

Members

NameDescription
RAW ๐Ÿ”นRAW message format.
JSON ๐Ÿ”นJSON message format.

RAW ๐Ÿ”น

RAW message format.


JSON ๐Ÿ”น

JSON message format.