IotRepublishMqttAction

class aws_cdk.aws_iot_actions.IotRepublishMqttAction(topic, *, quality_of_service=None, role=None)

Bases: object

(experimental) The action to put the record from an MQTT message to republish another MQTT topic.

Stability:

experimental

ExampleMetadata:

infused

Example:

iot.TopicRule(self, "TopicRule",
    sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp, temperature FROM 'device/+/data'"),
    actions=[
        actions.IotRepublishMqttAction("${topic()}/republish",
            quality_of_service=actions.MqttQualityOfService.AT_LEAST_ONCE
        )
    ]
)
Parameters:
  • topic (str) – The MQTT topic to which to republish the message.

  • quality_of_service (Optional[MqttQualityOfService]) – (experimental) The Quality of Service (QoS) level to use when republishing messages. Default: MqttQualityOfService.ZERO_OR_MORE_TIMES

  • role (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:

ActionConfig