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

interface SnsTopicActionProps ๐Ÿ”น

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

Configuration options for the SNS topic action.

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
    }),
  ],
});

Properties

NameTypeDescription
messageFormat?๐Ÿ”นSnsActionMessageFormatThe message format of the message to publish.
role?๐Ÿ”นIRoleThe IAM role that allows access to AWS service.

messageFormat?๐Ÿ”น

Type: SnsActionMessageFormat (optional, default: SnsActionMessageFormat.RAW)

The message format of the message to publish.

SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted.

See also: https://docs.aws.amazon.com/sns/latest/dg/sns-message-and-json-formats.html


role?๐Ÿ”น

Type: IRole (optional, default: a new role will be created)

The IAM role that allows access to AWS service.