SnsTopicAction
- class aws_cdk.aws_iot_actions.SnsTopicAction(topic, *, message_format=None, role=None)
Bases:
object
(experimental) The action to write the data from an MQTT message to an Amazon SNS topic.
- See:
https://docs.aws.amazon.com/iot/latest/developerguide/sns-rule-action.html
- Stability:
experimental
- ExampleMetadata:
infused
Example:
import aws_cdk.aws_sns as sns topic = sns.Topic(self, "MyTopic") topic_rule = iot.TopicRule(self, "TopicRule", sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"), actions=[ actions.SnsTopicAction(topic, message_format=actions.SnsActionMessageFormat.JSON ) ] )
- Parameters:
topic (
ITopic
) – The Amazon SNS topic to publish data on. Must not be a FIFO topic.message_format (
Optional
[SnsActionMessageFormat
]) – (experimental) 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. Default: SnsActionMessageFormat.RAWrole (
Optional
[IRole
]) – (experimental) The IAM role that allows access to AWS service. Default: a new role will be created
- Stability:
experimental
Methods
- bind(rule)
(experimental) Returns the topic rule action specification.
- Parameters:
rule (
ITopicRule
)- Stability:
experimental
- Return type: