IotEventsPutMessageActionProps

class aws_cdk.aws_iot_actions_alpha.IotEventsPutMessageActionProps(*, role=None, batch_mode=None, message_id=None)

Bases: CommonActionProps

(experimental) Configuration properties of an action for the IoT Events.

Parameters:
  • role (Optional[IRole]) – (experimental) The IAM role that allows access to AWS service. Default: a new role will be created

  • batch_mode (Optional[bool]) – (experimental) Whether to process the event actions as a batch. When batchMode is true, you can’t specify a messageId. When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is treated as a separate message when Events by calling BatchPutMessage. The resulting array can’t have more than 10 messages. Default: false

  • message_id (Optional[str]) – (experimental) The ID of the message. When batchMode is true, you can’t specify a messageId–a new UUID value will be assigned. Assign a value to this property to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector. Default: - none – a new UUID value will be assigned

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_iotevents_alpha as iotevents
import aws_cdk.aws_iam as iam

# role: iam.IRole


input = iotevents.Input(self, "MyInput",
    attribute_json_paths=["payload.temperature", "payload.transactionId"]
)
topic_rule = iot.TopicRule(self, "TopicRule",
    sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
    actions=[
        actions.IotEventsPutMessageAction(input,
            batch_mode=True,  # optional property, default is 'false'
            message_id="${payload.transactionId}",  # optional property, default is a new UUID
            role=role
        )
    ]
)

Attributes

batch_mode

(experimental) Whether to process the event actions as a batch.

When batchMode is true, you can’t specify a messageId.

When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is treated as a separate message when Events by calling BatchPutMessage. The resulting array can’t have more than 10 messages.

Default:

false

Stability:

experimental

message_id

(experimental) The ID of the message.

When batchMode is true, you can’t specify a messageId–a new UUID value will be assigned. Assign a value to this property to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

Default:
  • none – a new UUID value will be assigned

Stability:

experimental

role

(experimental) The IAM role that allows access to AWS service.

Default:

a new role will be created

Stability:

experimental