AWS IoT

2022/11/28 - AWS IoT - 6 updated api methods

Changes  Job scheduling enables the scheduled rollout of a Job with start and end times and a customizable end behavior when end time is reached. This is available for continuous and snapshot jobs. Added support for MQTT5 properties to AWS IoT TopicRule Republish Action.

CreateJob (updated) Link ¶
Changes (request)
{'schedulingConfig': {'endBehavior': 'STOP_ROLLOUT | CANCEL | FORCE_CANCEL',
                      'endTime': 'string',
                      'startTime': 'string'}}

Creates a job.

Requires permission to access the CreateJob action.

See also: AWS API Documentation

Request Syntax

client.create_job(
    jobId='string',
    targets=[
        'string',
    ],
    documentSource='string',
    document='string',
    description='string',
    presignedUrlConfig={
        'roleArn': 'string',
        'expiresInSec': 123
    },
    targetSelection='CONTINUOUS'|'SNAPSHOT',
    jobExecutionsRolloutConfig={
        'maximumPerMinute': 123,
        'exponentialRate': {
            'baseRatePerMinute': 123,
            'incrementFactor': 123.0,
            'rateIncreaseCriteria': {
                'numberOfNotifiedThings': 123,
                'numberOfSucceededThings': 123
            }
        }
    },
    abortConfig={
        'criteriaList': [
            {
                'failureType': 'FAILED'|'REJECTED'|'TIMED_OUT'|'ALL',
                'action': 'CANCEL',
                'thresholdPercentage': 123.0,
                'minNumberOfExecutedThings': 123
            },
        ]
    },
    timeoutConfig={
        'inProgressTimeoutInMinutes': 123
    },
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    namespaceId='string',
    jobTemplateArn='string',
    jobExecutionsRetryConfig={
        'criteriaList': [
            {
                'failureType': 'FAILED'|'TIMED_OUT'|'ALL',
                'numberOfRetries': 123
            },
        ]
    },
    documentParameters={
        'string': 'string'
    },
    schedulingConfig={
        'startTime': 'string',
        'endTime': 'string',
        'endBehavior': 'STOP_ROLLOUT'|'CANCEL'|'FORCE_CANCEL'
    }
)
type jobId:

string

param jobId:

[REQUIRED]

A job identifier which must be unique for your Amazon Web Services account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.

type targets:

list

param targets:

[REQUIRED]

A list of things and thing groups to which the job should be sent.

  • (string) --

type documentSource:

string

param documentSource:

An S3 link to the job document. Required if you don't specify a value for document.

type document:

string

param document:

The job document. Required if you don't specify a value for documentSource.

type description:

string

param description:

A short text description of the job.

type presignedUrlConfig:

dict

param presignedUrlConfig:

Configuration information for pre-signed S3 URLs.

  • roleArn (string) --

    The ARN of an IAM role that grants grants permission to download files from the S3 bucket where the job data/updates are stored. The role must also grant permission for IoT to download the files.

  • expiresInSec (integer) --

    How long (in seconds) pre-signed URLs are valid. Valid values are 60 - 3600, the default value is 3600 seconds. Pre-signed URLs are generated when Jobs receives an MQTT request for the job document.

type targetSelection:

string

param targetSelection:

Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.

type jobExecutionsRolloutConfig:

dict

param jobExecutionsRolloutConfig:

Allows you to create a staged rollout of the job.

  • maximumPerMinute (integer) --

    The maximum number of things that will be notified of a pending job, per minute. This parameter allows you to create a staged rollout.

  • exponentialRate (dict) --

    The rate of increase for a job rollout. This parameter allows you to define an exponential rate for a job rollout.

    • baseRatePerMinute (integer) -- [REQUIRED]

      The minimum number of things that will be notified of a pending job, per minute at the start of job rollout. This parameter allows you to define the initial rate of rollout.

    • incrementFactor (float) -- [REQUIRED]

      The exponential factor to increase the rate of rollout for a job.

      Amazon Web Services IoT Core supports up to one digit after the decimal (for example, 1.5, but not 1.55).

    • rateIncreaseCriteria (dict) -- [REQUIRED]

      The criteria to initiate the increase in rate of rollout for a job.

      • numberOfNotifiedThings (integer) --

        The threshold for number of notified things that will initiate the increase in rate of rollout.

      • numberOfSucceededThings (integer) --

        The threshold for number of succeeded things that will initiate the increase in rate of rollout.

type abortConfig:

dict

param abortConfig:

Allows you to create the criteria to abort a job.

  • criteriaList (list) -- [REQUIRED]

    The list of criteria that determine when and how to abort the job.

    • (dict) --

      The criteria that determine when and how a job abort takes place.

      • failureType (string) -- [REQUIRED]

        The type of job execution failures that can initiate a job abort.

      • action (string) -- [REQUIRED]

        The type of job action to take to initiate the job abort.

      • thresholdPercentage (float) -- [REQUIRED]

        The minimum percentage of job execution failures that must occur to initiate the job abort.

        Amazon Web Services IoT Core supports up to two digits after the decimal (for example, 10.9 and 10.99, but not 10.999).

      • minNumberOfExecutedThings (integer) -- [REQUIRED]

        The minimum number of things which must receive job execution notifications before the job can be aborted.

type timeoutConfig:

dict

param timeoutConfig:

Specifies the amount of time each device has to finish its execution of the job. The timer is started when the job execution status is set to IN_PROGRESS. If the job execution status is not set to another terminal state before the time expires, it will be automatically set to TIMED_OUT.

  • inProgressTimeoutInMinutes (integer) --

    Specifies the amount of time, in minutes, this device has to finish execution of this job. The timeout interval can be anywhere between 1 minute and 7 days (1 to 10080 minutes). The in progress timer can't be updated and will apply to all job executions for the job. Whenever a job execution remains in the IN_PROGRESS status for longer than this interval, the job execution will fail and switch to the terminal TIMED_OUT status.

type tags:

list

param tags:

Metadata which can be used to manage the job.

  • (dict) --

    A set of key/value pairs that are used to manage the resource.

    • Key (string) -- [REQUIRED]

      The tag's key.

    • Value (string) --

      The tag's value.

type namespaceId:

string

param namespaceId:

The namespace used to indicate that a job is a customer-managed job.

When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.

$aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/

type jobTemplateArn:

string

param jobTemplateArn:

The ARN of the job template used to create the job.

type jobExecutionsRetryConfig:

dict

param jobExecutionsRetryConfig:

Allows you to create the criteria to retry a job.

  • criteriaList (list) -- [REQUIRED]

    The list of criteria that determines how many retries are allowed for each failure type for a job.

    • (dict) --

      The criteria that determines how many retries are allowed for each failure type for a job.

      • failureType (string) -- [REQUIRED]

        The type of job execution failures that can initiate a job retry.

      • numberOfRetries (integer) -- [REQUIRED]

        The number of retries allowed for a failure type for the job.

type documentParameters:

dict

param documentParameters:

Parameters of an Amazon Web Services managed template that you can specify to create the job document.

  • (string) --

    • (string) --

type schedulingConfig:

dict

param schedulingConfig:

The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.

  • startTime (string) --

    The time a job will begin rollout of the job document to all devices in the target group for a job. The startTime can be scheduled up to a year in advance and must be scheduled a minimum of thirty minutes from the current time.

  • endTime (string) --

    The time a job will stop rollout of the job document to all devices in the target group for a job. The endTime must take place no later than two years from the current time and be scheduled a minimum of thirty minutes from the current time. The minimum duration between startTime and endTime is thirty minutes. The maximum duration between startTime and endTime is two years.

  • endBehavior (string) --

    Specifies the end behavior for all job executions after a job reaches the selected endTime. If endTime is not selected when creating the job, then endBehavior does not apply.

rtype:

dict

returns:

Response Syntax

{
    'jobArn': 'string',
    'jobId': 'string',
    'description': 'string'
}

Response Structure

  • (dict) --

    • jobArn (string) --

      The job ARN.

    • jobId (string) --

      The unique identifier you assigned to this job.

    • description (string) --

      The job description.

CreateTopicRule (updated) Link ¶
Changes (request)
{'topicRulePayload': {'actions': {'republish': {'headers': {'contentType': 'string',
                                                            'correlationData': 'string',
                                                            'messageExpiry': 'string',
                                                            'payloadFormatIndicator': 'string',
                                                            'responseTopic': 'string',
                                                            'userProperties': [{'key': 'string',
                                                                                'value': 'string'}]}}},
                      'errorAction': {'republish': {'headers': {'contentType': 'string',
                                                                'correlationData': 'string',
                                                                'messageExpiry': 'string',
                                                                'payloadFormatIndicator': 'string',
                                                                'responseTopic': 'string',
                                                                'userProperties': [{'key': 'string',
                                                                                    'value': 'string'}]}}}}}

Creates a rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Requires permission to access the CreateTopicRule action.

See also: AWS API Documentation

Request Syntax

client.create_topic_rule(
    ruleName='string',
    topicRulePayload={
        'sql': 'string',
        'description': 'string',
        'actions': [
            {
                'dynamoDB': {
                    'tableName': 'string',
                    'roleArn': 'string',
                    'operation': 'string',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'hashKeyType': 'STRING'|'NUMBER',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'rangeKeyType': 'STRING'|'NUMBER',
                    'payloadField': 'string'
                },
                'dynamoDBv2': {
                    'roleArn': 'string',
                    'putItem': {
                        'tableName': 'string'
                    }
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string',
                    'messageFormat': 'RAW'|'JSON'
                },
                'sqs': {
                    'roleArn': 'string',
                    'queueUrl': 'string',
                    'useBase64': True|False
                },
                'kinesis': {
                    'roleArn': 'string',
                    'streamName': 'string',
                    'partitionKey': 'string'
                },
                'republish': {
                    'roleArn': 'string',
                    'topic': 'string',
                    'qos': 123,
                    'headers': {
                        'payloadFormatIndicator': 'string',
                        'contentType': 'string',
                        'responseTopic': 'string',
                        'correlationData': 'string',
                        'messageExpiry': 'string',
                        'userProperties': [
                            {
                                'key': 'string',
                                'value': 'string'
                            },
                        ]
                    }
                },
                's3': {
                    'roleArn': 'string',
                    'bucketName': 'string',
                    'key': 'string',
                    'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
                },
                'firehose': {
                    'roleArn': 'string',
                    'deliveryStreamName': 'string',
                    'separator': 'string',
                    'batchMode': True|False
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'cloudwatchLogs': {
                    'roleArn': 'string',
                    'logGroupName': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'salesforce': {
                    'token': 'string',
                    'url': 'string'
                },
                'iotAnalytics': {
                    'channelArn': 'string',
                    'channelName': 'string',
                    'batchMode': True|False,
                    'roleArn': 'string'
                },
                'iotEvents': {
                    'inputName': 'string',
                    'messageId': 'string',
                    'batchMode': True|False,
                    'roleArn': 'string'
                },
                'iotSiteWise': {
                    'putAssetPropertyValueEntries': [
                        {
                            'entryId': 'string',
                            'assetId': 'string',
                            'propertyId': 'string',
                            'propertyAlias': 'string',
                            'propertyValues': [
                                {
                                    'value': {
                                        'stringValue': 'string',
                                        'integerValue': 'string',
                                        'doubleValue': 'string',
                                        'booleanValue': 'string'
                                    },
                                    'timestamp': {
                                        'timeInSeconds': 'string',
                                        'offsetInNanos': 'string'
                                    },
                                    'quality': 'string'
                                },
                            ]
                        },
                    ],
                    'roleArn': 'string'
                },
                'stepFunctions': {
                    'executionNamePrefix': 'string',
                    'stateMachineName': 'string',
                    'roleArn': 'string'
                },
                'timestream': {
                    'roleArn': 'string',
                    'databaseName': 'string',
                    'tableName': 'string',
                    'dimensions': [
                        {
                            'name': 'string',
                            'value': 'string'
                        },
                    ],
                    'timestamp': {
                        'value': 'string',
                        'unit': 'string'
                    }
                },
                'http': {
                    'url': 'string',
                    'confirmationUrl': 'string',
                    'headers': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ],
                    'auth': {
                        'sigv4': {
                            'signingRegion': 'string',
                            'serviceName': 'string',
                            'roleArn': 'string'
                        }
                    }
                },
                'kafka': {
                    'destinationArn': 'string',
                    'topic': 'string',
                    'key': 'string',
                    'partition': 'string',
                    'clientProperties': {
                        'string': 'string'
                    }
                },
                'openSearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'location': {
                    'roleArn': 'string',
                    'trackerName': 'string',
                    'deviceId': 'string',
                    'timestamp': {
                        'value': 'string',
                        'unit': 'string'
                    },
                    'latitude': 'string',
                    'longitude': 'string'
                }
            },
        ],
        'ruleDisabled': True|False,
        'awsIotSqlVersion': 'string',
        'errorAction': {
            'dynamoDB': {
                'tableName': 'string',
                'roleArn': 'string',
                'operation': 'string',
                'hashKeyField': 'string',
                'hashKeyValue': 'string',
                'hashKeyType': 'STRING'|'NUMBER',
                'rangeKeyField': 'string',
                'rangeKeyValue': 'string',
                'rangeKeyType': 'STRING'|'NUMBER',
                'payloadField': 'string'
            },
            'dynamoDBv2': {
                'roleArn': 'string',
                'putItem': {
                    'tableName': 'string'
                }
            },
            'lambda': {
                'functionArn': 'string'
            },
            'sns': {
                'targetArn': 'string',
                'roleArn': 'string',
                'messageFormat': 'RAW'|'JSON'
            },
            'sqs': {
                'roleArn': 'string',
                'queueUrl': 'string',
                'useBase64': True|False
            },
            'kinesis': {
                'roleArn': 'string',
                'streamName': 'string',
                'partitionKey': 'string'
            },
            'republish': {
                'roleArn': 'string',
                'topic': 'string',
                'qos': 123,
                'headers': {
                    'payloadFormatIndicator': 'string',
                    'contentType': 'string',
                    'responseTopic': 'string',
                    'correlationData': 'string',
                    'messageExpiry': 'string',
                    'userProperties': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ]
                }
            },
            's3': {
                'roleArn': 'string',
                'bucketName': 'string',
                'key': 'string',
                'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
            },
            'firehose': {
                'roleArn': 'string',
                'deliveryStreamName': 'string',
                'separator': 'string',
                'batchMode': True|False
            },
            'cloudwatchMetric': {
                'roleArn': 'string',
                'metricNamespace': 'string',
                'metricName': 'string',
                'metricValue': 'string',
                'metricUnit': 'string',
                'metricTimestamp': 'string'
            },
            'cloudwatchAlarm': {
                'roleArn': 'string',
                'alarmName': 'string',
                'stateReason': 'string',
                'stateValue': 'string'
            },
            'cloudwatchLogs': {
                'roleArn': 'string',
                'logGroupName': 'string'
            },
            'elasticsearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'salesforce': {
                'token': 'string',
                'url': 'string'
            },
            'iotAnalytics': {
                'channelArn': 'string',
                'channelName': 'string',
                'batchMode': True|False,
                'roleArn': 'string'
            },
            'iotEvents': {
                'inputName': 'string',
                'messageId': 'string',
                'batchMode': True|False,
                'roleArn': 'string'
            },
            'iotSiteWise': {
                'putAssetPropertyValueEntries': [
                    {
                        'entryId': 'string',
                        'assetId': 'string',
                        'propertyId': 'string',
                        'propertyAlias': 'string',
                        'propertyValues': [
                            {
                                'value': {
                                    'stringValue': 'string',
                                    'integerValue': 'string',
                                    'doubleValue': 'string',
                                    'booleanValue': 'string'
                                },
                                'timestamp': {
                                    'timeInSeconds': 'string',
                                    'offsetInNanos': 'string'
                                },
                                'quality': 'string'
                            },
                        ]
                    },
                ],
                'roleArn': 'string'
            },
            'stepFunctions': {
                'executionNamePrefix': 'string',
                'stateMachineName': 'string',
                'roleArn': 'string'
            },
            'timestream': {
                'roleArn': 'string',
                'databaseName': 'string',
                'tableName': 'string',
                'dimensions': [
                    {
                        'name': 'string',
                        'value': 'string'
                    },
                ],
                'timestamp': {
                    'value': 'string',
                    'unit': 'string'
                }
            },
            'http': {
                'url': 'string',
                'confirmationUrl': 'string',
                'headers': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ],
                'auth': {
                    'sigv4': {
                        'signingRegion': 'string',
                        'serviceName': 'string',
                        'roleArn': 'string'
                    }
                }
            },
            'kafka': {
                'destinationArn': 'string',
                'topic': 'string',
                'key': 'string',
                'partition': 'string',
                'clientProperties': {
                    'string': 'string'
                }
            },
            'openSearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'location': {
                'roleArn': 'string',
                'trackerName': 'string',
                'deviceId': 'string',
                'timestamp': {
                    'value': 'string',
                    'unit': 'string'
                },
                'latitude': 'string',
                'longitude': 'string'
            }
        }
    },
    tags='string'
)
type ruleName:

string

param ruleName:

[REQUIRED]

The name of the rule.

type topicRulePayload:

dict

param topicRulePayload:

[REQUIRED]

The rule payload.

  • sql (string) -- [REQUIRED]

    The SQL statement used to query the topic. For more information, see IoT SQL Reference in the IoT Developer Guide.

  • description (string) --

    The description of the rule.

  • actions (list) -- [REQUIRED]

    The actions associated with the rule.

    • (dict) --

      Describes the actions associated with a rule.

      • dynamoDB (dict) --

        Write to a DynamoDB table.

        • tableName (string) -- [REQUIRED]

          The name of the DynamoDB table.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the DynamoDB table.

        • operation (string) --

          The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

        • hashKeyField (string) -- [REQUIRED]

          The hash key name.

        • hashKeyValue (string) -- [REQUIRED]

          The hash key value.

        • hashKeyType (string) --

          The hash key type. Valid values are "STRING" or "NUMBER"

        • rangeKeyField (string) --

          The range key name.

        • rangeKeyValue (string) --

          The range key value.

        • rangeKeyType (string) --

          The range key type. Valid values are "STRING" or "NUMBER"

        • payloadField (string) --

          The action payload. This name can be customized.

      • dynamoDBv2 (dict) --

        Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the DynamoDB table.

        • putItem (dict) -- [REQUIRED]

          Specifies the DynamoDB table to which the message data will be written. For example:

          { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

          Each attribute in the message payload will be written to a separate column in the DynamoDB database.

          • tableName (string) -- [REQUIRED]

            The table where the message data will be written.

      • lambda (dict) --

        Invoke a Lambda function.

        • functionArn (string) -- [REQUIRED]

          The ARN of the Lambda function.

      • sns (dict) --

        Publish to an Amazon SNS topic.

        • targetArn (string) -- [REQUIRED]

          The ARN of the SNS topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • messageFormat (string) --

          (Optional) The message format of the message to publish. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see https://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

      • sqs (dict) --

        Publish to an Amazon SQS queue.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • queueUrl (string) -- [REQUIRED]

          The URL of the Amazon SQS queue.

        • useBase64 (boolean) --

          Specifies whether to use Base64 encoding.

      • kinesis (dict) --

        Write data to an Amazon Kinesis stream.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the Amazon Kinesis stream.

        • streamName (string) -- [REQUIRED]

          The name of the Amazon Kinesis stream.

        • partitionKey (string) --

          The partition key.

      • republish (dict) --

        Publish to another MQTT topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • topic (string) -- [REQUIRED]

          The name of the MQTT topic.

        • qos (integer) --

          The Quality of Service (QoS) level to use when republishing messages. The default value is 0.

        • headers (dict) --

          MQTT Version 5.0 headers information. For more information, see MQTT from the Amazon Web Services IoT Core Developer Guide.

          • payloadFormatIndicator (string) --

            An Enum string value that indicates whether the payload is formatted as UTF-8.

            Valid values are UNSPECIFIED_BYTES and UTF8_DATA.

            For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • contentType (string) --

            A UTF-8 encoded string that describes the content of the publishing message.

            For more information, see Content Type from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • responseTopic (string) --

            A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

            For more information, see Response Topic from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • correlationData (string) --

            The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received.

            For more information, see Correlation Data from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • messageExpiry (string) --

            A user-defined integer value that will persist a message at the message broker for a specified amount of time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of messageExpiry represents the number of seconds before it expires. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.

            Supports substitution templates.

          • userProperties (list) --

            An array of key-value pairs that you define in the MQTT5 header.

            • (dict) --

              A key-value pair that you define in the header. Both the key and the value are either literal strings or valid substitution templates.

              • key (string) -- [REQUIRED]

                A key to be specified in UserProperty.

              • value (string) -- [REQUIRED]

                A value to be specified in UserProperty.

      • s3 (dict) --

        Write to an Amazon S3 bucket.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • bucketName (string) -- [REQUIRED]

          The Amazon S3 bucket.

        • key (string) -- [REQUIRED]

          The object key. For more information, see Actions, resources, and condition keys for Amazon S3.

        • cannedAcl (string) --

          The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

      • firehose (dict) --

        Write to an Amazon Kinesis Firehose stream.

        • roleArn (string) -- [REQUIRED]

          The IAM role that grants access to the Amazon Kinesis Firehose stream.

        • deliveryStreamName (string) -- [REQUIRED]

          The delivery stream name.

        • separator (string) --

          A character separator that will be used to separate records written to the Firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

        • batchMode (boolean) --

          Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. The default value is false.

          When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

      • cloudwatchMetric (dict) --

        Capture a CloudWatch metric.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch metric.

        • metricNamespace (string) -- [REQUIRED]

          The CloudWatch metric namespace name.

        • metricName (string) -- [REQUIRED]

          The CloudWatch metric name.

        • metricValue (string) -- [REQUIRED]

          The CloudWatch metric value.

        • metricUnit (string) -- [REQUIRED]

          The metric unit supported by CloudWatch.

        • metricTimestamp (string) --

          An optional Unix timestamp.

      • cloudwatchAlarm (dict) --

        Change the state of a CloudWatch alarm.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch alarm.

        • alarmName (string) -- [REQUIRED]

          The CloudWatch alarm name.

        • stateReason (string) -- [REQUIRED]

          The reason for the alarm change.

        • stateValue (string) -- [REQUIRED]

          The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

      • cloudwatchLogs (dict) --

        Send data to CloudWatch Logs.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch log.

        • logGroupName (string) -- [REQUIRED]

          The CloudWatch log group to which the action sends data.

      • elasticsearch (dict) --

        Write data to an Amazon OpenSearch Service domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to OpenSearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your OpenSearch domain.

        • index (string) -- [REQUIRED]

          The index where you want to store your data.

        • type (string) -- [REQUIRED]

          The type of document you are storing.

        • id (string) -- [REQUIRED]

          The unique identifier for the document you are storing.

      • salesforce (dict) --

        Send a message to a Salesforce IoT Cloud Input Stream.

        • token (string) -- [REQUIRED]

          The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

        • url (string) -- [REQUIRED]

          The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

      • iotAnalytics (dict) --

        Sends message data to an IoT Analytics channel.

        • channelArn (string) --

          (deprecated) The ARN of the IoT Analytics channel to which message data will be sent.

        • channelName (string) --

          The name of the IoT Analytics channel to which message data will be sent.

        • batchMode (boolean) --

          Whether to process the action as a batch. The default value is false.

          When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by BatchPutMessage to the IoT Analytics channel. The resulting array can't have more than 100 messages.

        • roleArn (string) --

          The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).

      • iotEvents (dict) --

        Sends an input to an IoT Events detector.

        • inputName (string) -- [REQUIRED]

          The name of the IoT Events input.

        • messageId (string) --

          The ID of the message. The default messageId is a new UUID value.

          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 IoT Events detector.

        • batchMode (boolean) --

          Whether to process the event actions as a batch. The default value is false.

          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 it's sent to IoT Events by calling BatchPutMessage. The resulting array can't have more than 10 messages.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants IoT permission to send an input to an IoT Events detector. ("Action":"iotevents:BatchPutMessage").

      • iotSiteWise (dict) --

        Sends data from the MQTT message that triggered the rule to IoT SiteWise asset properties.

        • putAssetPropertyValueEntries (list) -- [REQUIRED]

          A list of asset property value entries.

          • (dict) --

            An asset property value entry containing the following information.

            • entryId (string) --

              Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.

            • assetId (string) --

              The ID of the IoT SiteWise asset. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

            • propertyId (string) --

              The ID of the asset's property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

            • propertyAlias (string) --

              The name of the property alias associated with your asset property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

            • propertyValues (list) -- [REQUIRED]

              A list of property values to insert that each contain timestamp, quality, and value (TQV) information.

              • (dict) --

                An asset property value entry containing the following information.

                • value (dict) -- [REQUIRED]

                  The value of the asset property.

                  • stringValue (string) --

                    Optional. The string value of the value entry. Accepts substitution templates.

                  • integerValue (string) --

                    Optional. A string that contains the integer value of the value entry. Accepts substitution templates.

                  • doubleValue (string) --

                    Optional. A string that contains the double value of the value entry. Accepts substitution templates.

                  • booleanValue (string) --

                    Optional. A string that contains the boolean value ( true or false) of the value entry. Accepts substitution templates.

                • timestamp (dict) -- [REQUIRED]

                  The asset property value timestamp.

                  • timeInSeconds (string) -- [REQUIRED]

                    A string that contains the time in seconds since epoch. Accepts substitution templates.

                  • offsetInNanos (string) --

                    Optional. A string that contains the nanosecond time offset. Accepts substitution templates.

                • quality (string) --

                  Optional. A string that describes the quality of the value. Accepts substitution templates. Must be GOOD, BAD, or UNCERTAIN.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. ( "Action": "iotsitewise:BatchPutAssetPropertyValue"). The trust policy can restrict access to specific asset hierarchy paths.

      • stepFunctions (dict) --

        Starts execution of a Step Functions state machine.

        • executionNamePrefix (string) --

          (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.

        • stateMachineName (string) -- [REQUIRED]

          The name of the Step Functions state machine whose execution will be started.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants IoT permission to start execution of a state machine ("Action":"states:StartExecution").

      • timestream (dict) --

        The Timestream rule action writes attributes (measures) from an MQTT message into an Amazon Timestream table. For more information, see the Timestream topic rule action documentation.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants permission to write to the Amazon Timestream database table.

        • databaseName (string) -- [REQUIRED]

          The name of an Amazon Timestream database.

        • tableName (string) -- [REQUIRED]

          The name of the database table into which to write the measure records.

        • dimensions (list) -- [REQUIRED]

          Metadata attributes of the time series that are written in each measure record.

          • (dict) --

            Metadata attributes of the time series that are written in each measure record.

            • name (string) -- [REQUIRED]

              The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.

              Dimensions cannot be named: measure_name, measure_value, or time. These names are reserved. Dimension names cannot start with ts_ or measure_value and they cannot contain the colon ( :) character.

            • value (string) -- [REQUIRED]

              The value to write in this column of the database record.

        • timestamp (dict) --

          Specifies an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column.

          You can use this property to specify the value and the precision of the Timestream record's timestamp. You can specify a value from the message payload or a value computed by a substitution template.

          If omitted, the topic rule action assigns the timestamp, in milliseconds, at the time it processed the rule.

          • value (string) -- [REQUIRED]

            An expression that returns a long epoch time value.

          • unit (string) -- [REQUIRED]

            The precision of the timestamp value that results from the expression described in value.

            Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

      • http (dict) --

        Send data to an HTTPS endpoint.

        • url (string) -- [REQUIRED]

          The endpoint URL. If substitution templates are used in the URL, you must also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination is created if possible.

        • confirmationUrl (string) --

          The URL to which IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.

        • headers (list) --

          The HTTP headers to send with the message data.

          • (dict) --

            The HTTP action header.

            • key (string) -- [REQUIRED]

              The HTTP header key.

            • value (string) -- [REQUIRED]

              The HTTP header value. Substitution templates are supported.

        • auth (dict) --

          The authentication method to use when sending data to an HTTPS endpoint.

          • sigv4 (dict) --

            Use Sig V4 authorization. For more information, see Signature Version 4 Signing Process.

            • signingRegion (string) -- [REQUIRED]

              The signing region.

            • serviceName (string) -- [REQUIRED]

              The service name to use while signing with Sig V4.

            • roleArn (string) -- [REQUIRED]

              The ARN of the signing role.

      • kafka (dict) --

        Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.

        • destinationArn (string) -- [REQUIRED]

          The ARN of Kafka action's VPC TopicRuleDestination.

        • topic (string) -- [REQUIRED]

          The Kafka topic for messages to be sent to the Kafka broker.

        • key (string) --

          The Kafka message key.

        • partition (string) --

          The Kafka message partition.

        • clientProperties (dict) -- [REQUIRED]

          Properties of the Apache Kafka producer client.

          • (string) --

            • (string) --

      • openSearch (dict) --

        Write data to an Amazon OpenSearch Service domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to OpenSearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your OpenSearch domain.

        • index (string) -- [REQUIRED]

          The OpenSearch index where you want to store your data.

        • type (string) -- [REQUIRED]

          The type of document you are storing.

        • id (string) -- [REQUIRED]

          The unique identifier for the document you are storing.

      • location (dict) --

        The Amazon Location Service rule action sends device location updates from an MQTT message to an Amazon Location tracker resource.

        • roleArn (string) -- [REQUIRED]

          The IAM role that grants permission to write to the Amazon Location resource.

        • trackerName (string) -- [REQUIRED]

          The name of the tracker resource in Amazon Location in which the location is updated.

        • deviceId (string) -- [REQUIRED]

          The unique ID of the device providing the location data.

        • timestamp (dict) --

          The time that the location data was sampled. The default value is the time the MQTT message was processed.

          • value (string) -- [REQUIRED]

            An expression that returns a long epoch time value.

          • unit (string) --

            The precision of the timestamp value that results from the expression described in value.

            Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

        • latitude (string) -- [REQUIRED]

          A string that evaluates to a double value that represents the latitude of the device's location.

        • longitude (string) -- [REQUIRED]

          A string that evaluates to a double value that represents the longitude of the device's location.

  • ruleDisabled (boolean) --

    Specifies whether the rule is disabled.

  • awsIotSqlVersion (string) --

    The version of the SQL rules engine to use when evaluating the rule.

  • errorAction (dict) --

    The action to take when an error occurs.

    • dynamoDB (dict) --

      Write to a DynamoDB table.

      • tableName (string) -- [REQUIRED]

        The name of the DynamoDB table.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access to the DynamoDB table.

      • operation (string) --

        The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

      • hashKeyField (string) -- [REQUIRED]

        The hash key name.

      • hashKeyValue (string) -- [REQUIRED]

        The hash key value.

      • hashKeyType (string) --

        The hash key type. Valid values are "STRING" or "NUMBER"

      • rangeKeyField (string) --

        The range key name.

      • rangeKeyValue (string) --

        The range key value.

      • rangeKeyType (string) --

        The range key type. Valid values are "STRING" or "NUMBER"

      • payloadField (string) --

        The action payload. This name can be customized.

    • dynamoDBv2 (dict) --

      Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access to the DynamoDB table.

      • putItem (dict) -- [REQUIRED]

        Specifies the DynamoDB table to which the message data will be written. For example:

        { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

        Each attribute in the message payload will be written to a separate column in the DynamoDB database.

        • tableName (string) -- [REQUIRED]

          The table where the message data will be written.

    • lambda (dict) --

      Invoke a Lambda function.

      • functionArn (string) -- [REQUIRED]

        The ARN of the Lambda function.

    • sns (dict) --

      Publish to an Amazon SNS topic.

      • targetArn (string) -- [REQUIRED]

        The ARN of the SNS topic.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • messageFormat (string) --

        (Optional) The message format of the message to publish. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see https://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

    • sqs (dict) --

      Publish to an Amazon SQS queue.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • queueUrl (string) -- [REQUIRED]

        The URL of the Amazon SQS queue.

      • useBase64 (boolean) --

        Specifies whether to use Base64 encoding.

    • kinesis (dict) --

      Write data to an Amazon Kinesis stream.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access to the Amazon Kinesis stream.

      • streamName (string) -- [REQUIRED]

        The name of the Amazon Kinesis stream.

      • partitionKey (string) --

        The partition key.

    • republish (dict) --

      Publish to another MQTT topic.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • topic (string) -- [REQUIRED]

        The name of the MQTT topic.

      • qos (integer) --

        The Quality of Service (QoS) level to use when republishing messages. The default value is 0.

      • headers (dict) --

        MQTT Version 5.0 headers information. For more information, see MQTT from the Amazon Web Services IoT Core Developer Guide.

        • payloadFormatIndicator (string) --

          An Enum string value that indicates whether the payload is formatted as UTF-8.

          Valid values are UNSPECIFIED_BYTES and UTF8_DATA.

          For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • contentType (string) --

          A UTF-8 encoded string that describes the content of the publishing message.

          For more information, see Content Type from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • responseTopic (string) --

          A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

          For more information, see Response Topic from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • correlationData (string) --

          The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received.

          For more information, see Correlation Data from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • messageExpiry (string) --

          A user-defined integer value that will persist a message at the message broker for a specified amount of time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of messageExpiry represents the number of seconds before it expires. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.

          Supports substitution templates.

        • userProperties (list) --

          An array of key-value pairs that you define in the MQTT5 header.

          • (dict) --

            A key-value pair that you define in the header. Both the key and the value are either literal strings or valid substitution templates.

            • key (string) -- [REQUIRED]

              A key to be specified in UserProperty.

            • value (string) -- [REQUIRED]

              A value to be specified in UserProperty.

    • s3 (dict) --

      Write to an Amazon S3 bucket.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • bucketName (string) -- [REQUIRED]

        The Amazon S3 bucket.

      • key (string) -- [REQUIRED]

        The object key. For more information, see Actions, resources, and condition keys for Amazon S3.

      • cannedAcl (string) --

        The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

    • firehose (dict) --

      Write to an Amazon Kinesis Firehose stream.

      • roleArn (string) -- [REQUIRED]

        The IAM role that grants access to the Amazon Kinesis Firehose stream.

      • deliveryStreamName (string) -- [REQUIRED]

        The delivery stream name.

      • separator (string) --

        A character separator that will be used to separate records written to the Firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

      • batchMode (boolean) --

        Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. The default value is false.

        When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

    • cloudwatchMetric (dict) --

      Capture a CloudWatch metric.

      • roleArn (string) -- [REQUIRED]

        The IAM role that allows access to the CloudWatch metric.

      • metricNamespace (string) -- [REQUIRED]

        The CloudWatch metric namespace name.

      • metricName (string) -- [REQUIRED]

        The CloudWatch metric name.

      • metricValue (string) -- [REQUIRED]

        The CloudWatch metric value.

      • metricUnit (string) -- [REQUIRED]

        The metric unit supported by CloudWatch.

      • metricTimestamp (string) --

        An optional Unix timestamp.

    • cloudwatchAlarm (dict) --

      Change the state of a CloudWatch alarm.

      • roleArn (string) -- [REQUIRED]

        The IAM role that allows access to the CloudWatch alarm.

      • alarmName (string) -- [REQUIRED]

        The CloudWatch alarm name.

      • stateReason (string) -- [REQUIRED]

        The reason for the alarm change.

      • stateValue (string) -- [REQUIRED]

        The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

    • cloudwatchLogs (dict) --

      Send data to CloudWatch Logs.

      • roleArn (string) -- [REQUIRED]

        The IAM role that allows access to the CloudWatch log.

      • logGroupName (string) -- [REQUIRED]

        The CloudWatch log group to which the action sends data.

    • elasticsearch (dict) --

      Write data to an Amazon OpenSearch Service domain.

      • roleArn (string) -- [REQUIRED]

        The IAM role ARN that has access to OpenSearch.

      • endpoint (string) -- [REQUIRED]

        The endpoint of your OpenSearch domain.

      • index (string) -- [REQUIRED]

        The index where you want to store your data.

      • type (string) -- [REQUIRED]

        The type of document you are storing.

      • id (string) -- [REQUIRED]

        The unique identifier for the document you are storing.

    • salesforce (dict) --

      Send a message to a Salesforce IoT Cloud Input Stream.

      • token (string) -- [REQUIRED]

        The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

      • url (string) -- [REQUIRED]

        The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

    • iotAnalytics (dict) --

      Sends message data to an IoT Analytics channel.

      • channelArn (string) --

        (deprecated) The ARN of the IoT Analytics channel to which message data will be sent.

      • channelName (string) --

        The name of the IoT Analytics channel to which message data will be sent.

      • batchMode (boolean) --

        Whether to process the action as a batch. The default value is false.

        When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by BatchPutMessage to the IoT Analytics channel. The resulting array can't have more than 100 messages.

      • roleArn (string) --

        The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).

    • iotEvents (dict) --

      Sends an input to an IoT Events detector.

      • inputName (string) -- [REQUIRED]

        The name of the IoT Events input.

      • messageId (string) --

        The ID of the message. The default messageId is a new UUID value.

        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 IoT Events detector.

      • batchMode (boolean) --

        Whether to process the event actions as a batch. The default value is false.

        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 it's sent to IoT Events by calling BatchPutMessage. The resulting array can't have more than 10 messages.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants IoT permission to send an input to an IoT Events detector. ("Action":"iotevents:BatchPutMessage").

    • iotSiteWise (dict) --

      Sends data from the MQTT message that triggered the rule to IoT SiteWise asset properties.

      • putAssetPropertyValueEntries (list) -- [REQUIRED]

        A list of asset property value entries.

        • (dict) --

          An asset property value entry containing the following information.

          • entryId (string) --

            Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.

          • assetId (string) --

            The ID of the IoT SiteWise asset. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

          • propertyId (string) --

            The ID of the asset's property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

          • propertyAlias (string) --

            The name of the property alias associated with your asset property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

          • propertyValues (list) -- [REQUIRED]

            A list of property values to insert that each contain timestamp, quality, and value (TQV) information.

            • (dict) --

              An asset property value entry containing the following information.

              • value (dict) -- [REQUIRED]

                The value of the asset property.

                • stringValue (string) --

                  Optional. The string value of the value entry. Accepts substitution templates.

                • integerValue (string) --

                  Optional. A string that contains the integer value of the value entry. Accepts substitution templates.

                • doubleValue (string) --

                  Optional. A string that contains the double value of the value entry. Accepts substitution templates.

                • booleanValue (string) --

                  Optional. A string that contains the boolean value ( true or false) of the value entry. Accepts substitution templates.

              • timestamp (dict) -- [REQUIRED]

                The asset property value timestamp.

                • timeInSeconds (string) -- [REQUIRED]

                  A string that contains the time in seconds since epoch. Accepts substitution templates.

                • offsetInNanos (string) --

                  Optional. A string that contains the nanosecond time offset. Accepts substitution templates.

              • quality (string) --

                Optional. A string that describes the quality of the value. Accepts substitution templates. Must be GOOD, BAD, or UNCERTAIN.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. ( "Action": "iotsitewise:BatchPutAssetPropertyValue"). The trust policy can restrict access to specific asset hierarchy paths.

    • stepFunctions (dict) --

      Starts execution of a Step Functions state machine.

      • executionNamePrefix (string) --

        (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.

      • stateMachineName (string) -- [REQUIRED]

        The name of the Step Functions state machine whose execution will be started.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants IoT permission to start execution of a state machine ("Action":"states:StartExecution").

    • timestream (dict) --

      The Timestream rule action writes attributes (measures) from an MQTT message into an Amazon Timestream table. For more information, see the Timestream topic rule action documentation.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants permission to write to the Amazon Timestream database table.

      • databaseName (string) -- [REQUIRED]

        The name of an Amazon Timestream database.

      • tableName (string) -- [REQUIRED]

        The name of the database table into which to write the measure records.

      • dimensions (list) -- [REQUIRED]

        Metadata attributes of the time series that are written in each measure record.

        • (dict) --

          Metadata attributes of the time series that are written in each measure record.

          • name (string) -- [REQUIRED]

            The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.

            Dimensions cannot be named: measure_name, measure_value, or time. These names are reserved. Dimension names cannot start with ts_ or measure_value and they cannot contain the colon ( :) character.

          • value (string) -- [REQUIRED]

            The value to write in this column of the database record.

      • timestamp (dict) --

        Specifies an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column.

        You can use this property to specify the value and the precision of the Timestream record's timestamp. You can specify a value from the message payload or a value computed by a substitution template.

        If omitted, the topic rule action assigns the timestamp, in milliseconds, at the time it processed the rule.

        • value (string) -- [REQUIRED]

          An expression that returns a long epoch time value.

        • unit (string) -- [REQUIRED]

          The precision of the timestamp value that results from the expression described in value.

          Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

    • http (dict) --

      Send data to an HTTPS endpoint.

      • url (string) -- [REQUIRED]

        The endpoint URL. If substitution templates are used in the URL, you must also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination is created if possible.

      • confirmationUrl (string) --

        The URL to which IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.

      • headers (list) --

        The HTTP headers to send with the message data.

        • (dict) --

          The HTTP action header.

          • key (string) -- [REQUIRED]

            The HTTP header key.

          • value (string) -- [REQUIRED]

            The HTTP header value. Substitution templates are supported.

      • auth (dict) --

        The authentication method to use when sending data to an HTTPS endpoint.

        • sigv4 (dict) --

          Use Sig V4 authorization. For more information, see Signature Version 4 Signing Process.

          • signingRegion (string) -- [REQUIRED]

            The signing region.

          • serviceName (string) -- [REQUIRED]

            The service name to use while signing with Sig V4.

          • roleArn (string) -- [REQUIRED]

            The ARN of the signing role.

    • kafka (dict) --

      Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.

      • destinationArn (string) -- [REQUIRED]

        The ARN of Kafka action's VPC TopicRuleDestination.

      • topic (string) -- [REQUIRED]

        The Kafka topic for messages to be sent to the Kafka broker.

      • key (string) --

        The Kafka message key.

      • partition (string) --

        The Kafka message partition.

      • clientProperties (dict) -- [REQUIRED]

        Properties of the Apache Kafka producer client.

        • (string) --

          • (string) --

    • openSearch (dict) --

      Write data to an Amazon OpenSearch Service domain.

      • roleArn (string) -- [REQUIRED]

        The IAM role ARN that has access to OpenSearch.

      • endpoint (string) -- [REQUIRED]

        The endpoint of your OpenSearch domain.

      • index (string) -- [REQUIRED]

        The OpenSearch index where you want to store your data.

      • type (string) -- [REQUIRED]

        The type of document you are storing.

      • id (string) -- [REQUIRED]

        The unique identifier for the document you are storing.

    • location (dict) --

      The Amazon Location Service rule action sends device location updates from an MQTT message to an Amazon Location tracker resource.

      • roleArn (string) -- [REQUIRED]

        The IAM role that grants permission to write to the Amazon Location resource.

      • trackerName (string) -- [REQUIRED]

        The name of the tracker resource in Amazon Location in which the location is updated.

      • deviceId (string) -- [REQUIRED]

        The unique ID of the device providing the location data.

      • timestamp (dict) --

        The time that the location data was sampled. The default value is the time the MQTT message was processed.

        • value (string) -- [REQUIRED]

          An expression that returns a long epoch time value.

        • unit (string) --

          The precision of the timestamp value that results from the expression described in value.

          Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

      • latitude (string) -- [REQUIRED]

        A string that evaluates to a double value that represents the latitude of the device's location.

      • longitude (string) -- [REQUIRED]

        A string that evaluates to a double value that represents the longitude of the device's location.

type tags:

string

param tags:

Metadata which can be used to manage the topic rule.

returns:

None

DescribeJob (updated) Link ¶
Changes (response)
{'job': {'schedulingConfig': {'endBehavior': 'STOP_ROLLOUT | CANCEL | '
                                             'FORCE_CANCEL',
                              'endTime': 'string',
                              'startTime': 'string'},
         'status': {'SCHEDULED'}}}

Describes a job.

Requires permission to access the DescribeJob action.

See also: AWS API Documentation

Request Syntax

client.describe_job(
    jobId='string'
)
type jobId:

string

param jobId:

[REQUIRED]

The unique identifier you assigned to this job when it was created.

rtype:

dict

returns:

Response Syntax

{
    'documentSource': 'string',
    'job': {
        'jobArn': 'string',
        'jobId': 'string',
        'targetSelection': 'CONTINUOUS'|'SNAPSHOT',
        'status': 'IN_PROGRESS'|'CANCELED'|'COMPLETED'|'DELETION_IN_PROGRESS'|'SCHEDULED',
        'forceCanceled': True|False,
        'reasonCode': 'string',
        'comment': 'string',
        'targets': [
            'string',
        ],
        'description': 'string',
        'presignedUrlConfig': {
            'roleArn': 'string',
            'expiresInSec': 123
        },
        'jobExecutionsRolloutConfig': {
            'maximumPerMinute': 123,
            'exponentialRate': {
                'baseRatePerMinute': 123,
                'incrementFactor': 123.0,
                'rateIncreaseCriteria': {
                    'numberOfNotifiedThings': 123,
                    'numberOfSucceededThings': 123
                }
            }
        },
        'abortConfig': {
            'criteriaList': [
                {
                    'failureType': 'FAILED'|'REJECTED'|'TIMED_OUT'|'ALL',
                    'action': 'CANCEL',
                    'thresholdPercentage': 123.0,
                    'minNumberOfExecutedThings': 123
                },
            ]
        },
        'createdAt': datetime(2015, 1, 1),
        'lastUpdatedAt': datetime(2015, 1, 1),
        'completedAt': datetime(2015, 1, 1),
        'jobProcessDetails': {
            'processingTargets': [
                'string',
            ],
            'numberOfCanceledThings': 123,
            'numberOfSucceededThings': 123,
            'numberOfFailedThings': 123,
            'numberOfRejectedThings': 123,
            'numberOfQueuedThings': 123,
            'numberOfInProgressThings': 123,
            'numberOfRemovedThings': 123,
            'numberOfTimedOutThings': 123
        },
        'timeoutConfig': {
            'inProgressTimeoutInMinutes': 123
        },
        'namespaceId': 'string',
        'jobTemplateArn': 'string',
        'jobExecutionsRetryConfig': {
            'criteriaList': [
                {
                    'failureType': 'FAILED'|'TIMED_OUT'|'ALL',
                    'numberOfRetries': 123
                },
            ]
        },
        'documentParameters': {
            'string': 'string'
        },
        'isConcurrent': True|False,
        'schedulingConfig': {
            'startTime': 'string',
            'endTime': 'string',
            'endBehavior': 'STOP_ROLLOUT'|'CANCEL'|'FORCE_CANCEL'
        }
    }
}

Response Structure

  • (dict) --

    • documentSource (string) --

      An S3 link to the job document.

    • job (dict) --

      Information about the job.

      • jobArn (string) --

        An ARN identifying the job with format "arn:aws:iot:region:account:job/jobId".

      • jobId (string) --

        The unique identifier you assigned to this job when it was created.

      • targetSelection (string) --

        Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a device when the thing representing the device is added to a target group, even after the job was completed by all things originally in the group.

      • status (string) --

        The status of the job, one of IN_PROGRESS, CANCELED, DELETION_IN_PROGRESS or COMPLETED.

      • forceCanceled (boolean) --

        Will be true if the job was canceled with the optional force parameter set to true.

      • reasonCode (string) --

        If the job was updated, provides the reason code for the update.

      • comment (string) --

        If the job was updated, describes the reason for the update.

      • targets (list) --

        A list of IoT things and thing groups to which the job should be sent.

        • (string) --

      • description (string) --

        A short text description of the job.

      • presignedUrlConfig (dict) --

        Configuration for pre-signed S3 URLs.

        • roleArn (string) --

          The ARN of an IAM role that grants grants permission to download files from the S3 bucket where the job data/updates are stored. The role must also grant permission for IoT to download the files.

        • expiresInSec (integer) --

          How long (in seconds) pre-signed URLs are valid. Valid values are 60 - 3600, the default value is 3600 seconds. Pre-signed URLs are generated when Jobs receives an MQTT request for the job document.

      • jobExecutionsRolloutConfig (dict) --

        Allows you to create a staged rollout of a job.

        • maximumPerMinute (integer) --

          The maximum number of things that will be notified of a pending job, per minute. This parameter allows you to create a staged rollout.

        • exponentialRate (dict) --

          The rate of increase for a job rollout. This parameter allows you to define an exponential rate for a job rollout.

          • baseRatePerMinute (integer) --

            The minimum number of things that will be notified of a pending job, per minute at the start of job rollout. This parameter allows you to define the initial rate of rollout.

          • incrementFactor (float) --

            The exponential factor to increase the rate of rollout for a job.

            Amazon Web Services IoT Core supports up to one digit after the decimal (for example, 1.5, but not 1.55).

          • rateIncreaseCriteria (dict) --

            The criteria to initiate the increase in rate of rollout for a job.

            • numberOfNotifiedThings (integer) --

              The threshold for number of notified things that will initiate the increase in rate of rollout.

            • numberOfSucceededThings (integer) --

              The threshold for number of succeeded things that will initiate the increase in rate of rollout.

      • abortConfig (dict) --

        Configuration for criteria to abort the job.

        • criteriaList (list) --

          The list of criteria that determine when and how to abort the job.

          • (dict) --

            The criteria that determine when and how a job abort takes place.

            • failureType (string) --

              The type of job execution failures that can initiate a job abort.

            • action (string) --

              The type of job action to take to initiate the job abort.

            • thresholdPercentage (float) --

              The minimum percentage of job execution failures that must occur to initiate the job abort.

              Amazon Web Services IoT Core supports up to two digits after the decimal (for example, 10.9 and 10.99, but not 10.999).

            • minNumberOfExecutedThings (integer) --

              The minimum number of things which must receive job execution notifications before the job can be aborted.

      • createdAt (datetime) --

        The time, in seconds since the epoch, when the job was created.

      • lastUpdatedAt (datetime) --

        The time, in seconds since the epoch, when the job was last updated.

      • completedAt (datetime) --

        The time, in seconds since the epoch, when the job was completed.

      • jobProcessDetails (dict) --

        Details about the job process.

        • processingTargets (list) --

          The target devices to which the job execution is being rolled out. This value will be null after the job execution has finished rolling out to all the target devices.

          • (string) --

        • numberOfCanceledThings (integer) --

          The number of things that cancelled the job.

        • numberOfSucceededThings (integer) --

          The number of things which successfully completed the job.

        • numberOfFailedThings (integer) --

          The number of things that failed executing the job.

        • numberOfRejectedThings (integer) --

          The number of things that rejected the job.

        • numberOfQueuedThings (integer) --

          The number of things that are awaiting execution of the job.

        • numberOfInProgressThings (integer) --

          The number of things currently executing the job.

        • numberOfRemovedThings (integer) --

          The number of things that are no longer scheduled to execute the job because they have been deleted or have been removed from the group that was a target of the job.

        • numberOfTimedOutThings (integer) --

          The number of things whose job execution status is TIMED_OUT.

      • timeoutConfig (dict) --

        Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to IN_PROGRESS. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to TIMED_OUT.

        • inProgressTimeoutInMinutes (integer) --

          Specifies the amount of time, in minutes, this device has to finish execution of this job. The timeout interval can be anywhere between 1 minute and 7 days (1 to 10080 minutes). The in progress timer can't be updated and will apply to all job executions for the job. Whenever a job execution remains in the IN_PROGRESS status for longer than this interval, the job execution will fail and switch to the terminal TIMED_OUT status.

      • namespaceId (string) --

        The namespace used to indicate that a job is a customer-managed job.

        When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.

        $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/

      • jobTemplateArn (string) --

        The ARN of the job template used to create the job.

      • jobExecutionsRetryConfig (dict) --

        The configuration for the criteria to retry the job.

        • criteriaList (list) --

          The list of criteria that determines how many retries are allowed for each failure type for a job.

          • (dict) --

            The criteria that determines how many retries are allowed for each failure type for a job.

            • failureType (string) --

              The type of job execution failures that can initiate a job retry.

            • numberOfRetries (integer) --

              The number of retries allowed for a failure type for the job.

      • documentParameters (dict) --

        A key-value map that pairs the patterns that need to be replaced in a managed template job document schema. You can use the description of each key as a guidance to specify the inputs during runtime when creating a job.

        • (string) --

          • (string) --

      • isConcurrent (boolean) --

        Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.

      • schedulingConfig (dict) --

        The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.

        • startTime (string) --

          The time a job will begin rollout of the job document to all devices in the target group for a job. The startTime can be scheduled up to a year in advance and must be scheduled a minimum of thirty minutes from the current time.

        • endTime (string) --

          The time a job will stop rollout of the job document to all devices in the target group for a job. The endTime must take place no later than two years from the current time and be scheduled a minimum of thirty minutes from the current time. The minimum duration between startTime and endTime is thirty minutes. The maximum duration between startTime and endTime is two years.

        • endBehavior (string) --

          Specifies the end behavior for all job executions after a job reaches the selected endTime. If endTime is not selected when creating the job, then endBehavior does not apply.

GetTopicRule (updated) Link ¶
Changes (response)
{'rule': {'actions': {'republish': {'headers': {'contentType': 'string',
                                                'correlationData': 'string',
                                                'messageExpiry': 'string',
                                                'payloadFormatIndicator': 'string',
                                                'responseTopic': 'string',
                                                'userProperties': [{'key': 'string',
                                                                    'value': 'string'}]}}},
          'errorAction': {'republish': {'headers': {'contentType': 'string',
                                                    'correlationData': 'string',
                                                    'messageExpiry': 'string',
                                                    'payloadFormatIndicator': 'string',
                                                    'responseTopic': 'string',
                                                    'userProperties': [{'key': 'string',
                                                                        'value': 'string'}]}}}}}

Gets information about the rule.

Requires permission to access the GetTopicRule action.

See also: AWS API Documentation

Request Syntax

client.get_topic_rule(
    ruleName='string'
)
type ruleName:

string

param ruleName:

[REQUIRED]

The name of the rule.

rtype:

dict

returns:

Response Syntax

{
    'ruleArn': 'string',
    'rule': {
        'ruleName': 'string',
        'sql': 'string',
        'description': 'string',
        'createdAt': datetime(2015, 1, 1),
        'actions': [
            {
                'dynamoDB': {
                    'tableName': 'string',
                    'roleArn': 'string',
                    'operation': 'string',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'hashKeyType': 'STRING'|'NUMBER',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'rangeKeyType': 'STRING'|'NUMBER',
                    'payloadField': 'string'
                },
                'dynamoDBv2': {
                    'roleArn': 'string',
                    'putItem': {
                        'tableName': 'string'
                    }
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string',
                    'messageFormat': 'RAW'|'JSON'
                },
                'sqs': {
                    'roleArn': 'string',
                    'queueUrl': 'string',
                    'useBase64': True|False
                },
                'kinesis': {
                    'roleArn': 'string',
                    'streamName': 'string',
                    'partitionKey': 'string'
                },
                'republish': {
                    'roleArn': 'string',
                    'topic': 'string',
                    'qos': 123,
                    'headers': {
                        'payloadFormatIndicator': 'string',
                        'contentType': 'string',
                        'responseTopic': 'string',
                        'correlationData': 'string',
                        'messageExpiry': 'string',
                        'userProperties': [
                            {
                                'key': 'string',
                                'value': 'string'
                            },
                        ]
                    }
                },
                's3': {
                    'roleArn': 'string',
                    'bucketName': 'string',
                    'key': 'string',
                    'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
                },
                'firehose': {
                    'roleArn': 'string',
                    'deliveryStreamName': 'string',
                    'separator': 'string',
                    'batchMode': True|False
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'cloudwatchLogs': {
                    'roleArn': 'string',
                    'logGroupName': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'salesforce': {
                    'token': 'string',
                    'url': 'string'
                },
                'iotAnalytics': {
                    'channelArn': 'string',
                    'channelName': 'string',
                    'batchMode': True|False,
                    'roleArn': 'string'
                },
                'iotEvents': {
                    'inputName': 'string',
                    'messageId': 'string',
                    'batchMode': True|False,
                    'roleArn': 'string'
                },
                'iotSiteWise': {
                    'putAssetPropertyValueEntries': [
                        {
                            'entryId': 'string',
                            'assetId': 'string',
                            'propertyId': 'string',
                            'propertyAlias': 'string',
                            'propertyValues': [
                                {
                                    'value': {
                                        'stringValue': 'string',
                                        'integerValue': 'string',
                                        'doubleValue': 'string',
                                        'booleanValue': 'string'
                                    },
                                    'timestamp': {
                                        'timeInSeconds': 'string',
                                        'offsetInNanos': 'string'
                                    },
                                    'quality': 'string'
                                },
                            ]
                        },
                    ],
                    'roleArn': 'string'
                },
                'stepFunctions': {
                    'executionNamePrefix': 'string',
                    'stateMachineName': 'string',
                    'roleArn': 'string'
                },
                'timestream': {
                    'roleArn': 'string',
                    'databaseName': 'string',
                    'tableName': 'string',
                    'dimensions': [
                        {
                            'name': 'string',
                            'value': 'string'
                        },
                    ],
                    'timestamp': {
                        'value': 'string',
                        'unit': 'string'
                    }
                },
                'http': {
                    'url': 'string',
                    'confirmationUrl': 'string',
                    'headers': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ],
                    'auth': {
                        'sigv4': {
                            'signingRegion': 'string',
                            'serviceName': 'string',
                            'roleArn': 'string'
                        }
                    }
                },
                'kafka': {
                    'destinationArn': 'string',
                    'topic': 'string',
                    'key': 'string',
                    'partition': 'string',
                    'clientProperties': {
                        'string': 'string'
                    }
                },
                'openSearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'location': {
                    'roleArn': 'string',
                    'trackerName': 'string',
                    'deviceId': 'string',
                    'timestamp': {
                        'value': 'string',
                        'unit': 'string'
                    },
                    'latitude': 'string',
                    'longitude': 'string'
                }
            },
        ],
        'ruleDisabled': True|False,
        'awsIotSqlVersion': 'string',
        'errorAction': {
            'dynamoDB': {
                'tableName': 'string',
                'roleArn': 'string',
                'operation': 'string',
                'hashKeyField': 'string',
                'hashKeyValue': 'string',
                'hashKeyType': 'STRING'|'NUMBER',
                'rangeKeyField': 'string',
                'rangeKeyValue': 'string',
                'rangeKeyType': 'STRING'|'NUMBER',
                'payloadField': 'string'
            },
            'dynamoDBv2': {
                'roleArn': 'string',
                'putItem': {
                    'tableName': 'string'
                }
            },
            'lambda': {
                'functionArn': 'string'
            },
            'sns': {
                'targetArn': 'string',
                'roleArn': 'string',
                'messageFormat': 'RAW'|'JSON'
            },
            'sqs': {
                'roleArn': 'string',
                'queueUrl': 'string',
                'useBase64': True|False
            },
            'kinesis': {
                'roleArn': 'string',
                'streamName': 'string',
                'partitionKey': 'string'
            },
            'republish': {
                'roleArn': 'string',
                'topic': 'string',
                'qos': 123,
                'headers': {
                    'payloadFormatIndicator': 'string',
                    'contentType': 'string',
                    'responseTopic': 'string',
                    'correlationData': 'string',
                    'messageExpiry': 'string',
                    'userProperties': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ]
                }
            },
            's3': {
                'roleArn': 'string',
                'bucketName': 'string',
                'key': 'string',
                'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
            },
            'firehose': {
                'roleArn': 'string',
                'deliveryStreamName': 'string',
                'separator': 'string',
                'batchMode': True|False
            },
            'cloudwatchMetric': {
                'roleArn': 'string',
                'metricNamespace': 'string',
                'metricName': 'string',
                'metricValue': 'string',
                'metricUnit': 'string',
                'metricTimestamp': 'string'
            },
            'cloudwatchAlarm': {
                'roleArn': 'string',
                'alarmName': 'string',
                'stateReason': 'string',
                'stateValue': 'string'
            },
            'cloudwatchLogs': {
                'roleArn': 'string',
                'logGroupName': 'string'
            },
            'elasticsearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'salesforce': {
                'token': 'string',
                'url': 'string'
            },
            'iotAnalytics': {
                'channelArn': 'string',
                'channelName': 'string',
                'batchMode': True|False,
                'roleArn': 'string'
            },
            'iotEvents': {
                'inputName': 'string',
                'messageId': 'string',
                'batchMode': True|False,
                'roleArn': 'string'
            },
            'iotSiteWise': {
                'putAssetPropertyValueEntries': [
                    {
                        'entryId': 'string',
                        'assetId': 'string',
                        'propertyId': 'string',
                        'propertyAlias': 'string',
                        'propertyValues': [
                            {
                                'value': {
                                    'stringValue': 'string',
                                    'integerValue': 'string',
                                    'doubleValue': 'string',
                                    'booleanValue': 'string'
                                },
                                'timestamp': {
                                    'timeInSeconds': 'string',
                                    'offsetInNanos': 'string'
                                },
                                'quality': 'string'
                            },
                        ]
                    },
                ],
                'roleArn': 'string'
            },
            'stepFunctions': {
                'executionNamePrefix': 'string',
                'stateMachineName': 'string',
                'roleArn': 'string'
            },
            'timestream': {
                'roleArn': 'string',
                'databaseName': 'string',
                'tableName': 'string',
                'dimensions': [
                    {
                        'name': 'string',
                        'value': 'string'
                    },
                ],
                'timestamp': {
                    'value': 'string',
                    'unit': 'string'
                }
            },
            'http': {
                'url': 'string',
                'confirmationUrl': 'string',
                'headers': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ],
                'auth': {
                    'sigv4': {
                        'signingRegion': 'string',
                        'serviceName': 'string',
                        'roleArn': 'string'
                    }
                }
            },
            'kafka': {
                'destinationArn': 'string',
                'topic': 'string',
                'key': 'string',
                'partition': 'string',
                'clientProperties': {
                    'string': 'string'
                }
            },
            'openSearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'location': {
                'roleArn': 'string',
                'trackerName': 'string',
                'deviceId': 'string',
                'timestamp': {
                    'value': 'string',
                    'unit': 'string'
                },
                'latitude': 'string',
                'longitude': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    The output from the GetTopicRule operation.

    • ruleArn (string) --

      The rule ARN.

    • rule (dict) --

      The rule.

      • ruleName (string) --

        The name of the rule.

      • sql (string) --

        The SQL statement used to query the topic. When using a SQL query with multiple lines, be sure to escape the newline characters.

      • description (string) --

        The description of the rule.

      • createdAt (datetime) --

        The date and time the rule was created.

      • actions (list) --

        The actions associated with the rule.

        • (dict) --

          Describes the actions associated with a rule.

          • dynamoDB (dict) --

            Write to a DynamoDB table.

            • tableName (string) --

              The name of the DynamoDB table.

            • roleArn (string) --

              The ARN of the IAM role that grants access to the DynamoDB table.

            • operation (string) --

              The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

            • hashKeyField (string) --

              The hash key name.

            • hashKeyValue (string) --

              The hash key value.

            • hashKeyType (string) --

              The hash key type. Valid values are "STRING" or "NUMBER"

            • rangeKeyField (string) --

              The range key name.

            • rangeKeyValue (string) --

              The range key value.

            • rangeKeyType (string) --

              The range key type. Valid values are "STRING" or "NUMBER"

            • payloadField (string) --

              The action payload. This name can be customized.

          • dynamoDBv2 (dict) --

            Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

            • roleArn (string) --

              The ARN of the IAM role that grants access to the DynamoDB table.

            • putItem (dict) --

              Specifies the DynamoDB table to which the message data will be written. For example:

              { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

              Each attribute in the message payload will be written to a separate column in the DynamoDB database.

              • tableName (string) --

                The table where the message data will be written.

          • lambda (dict) --

            Invoke a Lambda function.

            • functionArn (string) --

              The ARN of the Lambda function.

          • sns (dict) --

            Publish to an Amazon SNS topic.

            • targetArn (string) --

              The ARN of the SNS topic.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • messageFormat (string) --

              (Optional) The message format of the message to publish. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see https://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

          • sqs (dict) --

            Publish to an Amazon SQS queue.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • queueUrl (string) --

              The URL of the Amazon SQS queue.

            • useBase64 (boolean) --

              Specifies whether to use Base64 encoding.

          • kinesis (dict) --

            Write data to an Amazon Kinesis stream.

            • roleArn (string) --

              The ARN of the IAM role that grants access to the Amazon Kinesis stream.

            • streamName (string) --

              The name of the Amazon Kinesis stream.

            • partitionKey (string) --

              The partition key.

          • republish (dict) --

            Publish to another MQTT topic.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • topic (string) --

              The name of the MQTT topic.

            • qos (integer) --

              The Quality of Service (QoS) level to use when republishing messages. The default value is 0.

            • headers (dict) --

              MQTT Version 5.0 headers information. For more information, see MQTT from the Amazon Web Services IoT Core Developer Guide.

              • payloadFormatIndicator (string) --

                An Enum string value that indicates whether the payload is formatted as UTF-8.

                Valid values are UNSPECIFIED_BYTES and UTF8_DATA.

                For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.

                Supports substitution templates.

              • contentType (string) --

                A UTF-8 encoded string that describes the content of the publishing message.

                For more information, see Content Type from the MQTT Version 5.0 specification.

                Supports substitution templates.

              • responseTopic (string) --

                A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

                For more information, see Response Topic from the MQTT Version 5.0 specification.

                Supports substitution templates.

              • correlationData (string) --

                The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received.

                For more information, see Correlation Data from the MQTT Version 5.0 specification.

                Supports substitution templates.

              • messageExpiry (string) --

                A user-defined integer value that will persist a message at the message broker for a specified amount of time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of messageExpiry represents the number of seconds before it expires. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.

                Supports substitution templates.

              • userProperties (list) --

                An array of key-value pairs that you define in the MQTT5 header.

                • (dict) --

                  A key-value pair that you define in the header. Both the key and the value are either literal strings or valid substitution templates.

                  • key (string) --

                    A key to be specified in UserProperty.

                  • value (string) --

                    A value to be specified in UserProperty.

          • s3 (dict) --

            Write to an Amazon S3 bucket.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • bucketName (string) --

              The Amazon S3 bucket.

            • key (string) --

              The object key. For more information, see Actions, resources, and condition keys for Amazon S3.

            • cannedAcl (string) --

              The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

          • firehose (dict) --

            Write to an Amazon Kinesis Firehose stream.

            • roleArn (string) --

              The IAM role that grants access to the Amazon Kinesis Firehose stream.

            • deliveryStreamName (string) --

              The delivery stream name.

            • separator (string) --

              A character separator that will be used to separate records written to the Firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

            • batchMode (boolean) --

              Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. The default value is false.

              When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

          • cloudwatchMetric (dict) --

            Capture a CloudWatch metric.

            • roleArn (string) --

              The IAM role that allows access to the CloudWatch metric.

            • metricNamespace (string) --

              The CloudWatch metric namespace name.

            • metricName (string) --

              The CloudWatch metric name.

            • metricValue (string) --

              The CloudWatch metric value.

            • metricUnit (string) --

              The metric unit supported by CloudWatch.

            • metricTimestamp (string) --

              An optional Unix timestamp.

          • cloudwatchAlarm (dict) --

            Change the state of a CloudWatch alarm.

            • roleArn (string) --

              The IAM role that allows access to the CloudWatch alarm.

            • alarmName (string) --

              The CloudWatch alarm name.

            • stateReason (string) --

              The reason for the alarm change.

            • stateValue (string) --

              The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

          • cloudwatchLogs (dict) --

            Send data to CloudWatch Logs.

            • roleArn (string) --

              The IAM role that allows access to the CloudWatch log.

            • logGroupName (string) --

              The CloudWatch log group to which the action sends data.

          • elasticsearch (dict) --

            Write data to an Amazon OpenSearch Service domain.

            • roleArn (string) --

              The IAM role ARN that has access to OpenSearch.

            • endpoint (string) --

              The endpoint of your OpenSearch domain.

            • index (string) --

              The index where you want to store your data.

            • type (string) --

              The type of document you are storing.

            • id (string) --

              The unique identifier for the document you are storing.

          • salesforce (dict) --

            Send a message to a Salesforce IoT Cloud Input Stream.

            • token (string) --

              The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

            • url (string) --

              The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

          • iotAnalytics (dict) --

            Sends message data to an IoT Analytics channel.

            • channelArn (string) --

              (deprecated) The ARN of the IoT Analytics channel to which message data will be sent.

            • channelName (string) --

              The name of the IoT Analytics channel to which message data will be sent.

            • batchMode (boolean) --

              Whether to process the action as a batch. The default value is false.

              When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by BatchPutMessage to the IoT Analytics channel. The resulting array can't have more than 100 messages.

            • roleArn (string) --

              The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).

          • iotEvents (dict) --

            Sends an input to an IoT Events detector.

            • inputName (string) --

              The name of the IoT Events input.

            • messageId (string) --

              The ID of the message. The default messageId is a new UUID value.

              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 IoT Events detector.

            • batchMode (boolean) --

              Whether to process the event actions as a batch. The default value is false.

              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 it's sent to IoT Events by calling BatchPutMessage. The resulting array can't have more than 10 messages.

            • roleArn (string) --

              The ARN of the role that grants IoT permission to send an input to an IoT Events detector. ("Action":"iotevents:BatchPutMessage").

          • iotSiteWise (dict) --

            Sends data from the MQTT message that triggered the rule to IoT SiteWise asset properties.

            • putAssetPropertyValueEntries (list) --

              A list of asset property value entries.

              • (dict) --

                An asset property value entry containing the following information.

                • entryId (string) --

                  Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.

                • assetId (string) --

                  The ID of the IoT SiteWise asset. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

                • propertyId (string) --

                  The ID of the asset's property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

                • propertyAlias (string) --

                  The name of the property alias associated with your asset property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

                • propertyValues (list) --

                  A list of property values to insert that each contain timestamp, quality, and value (TQV) information.

                  • (dict) --

                    An asset property value entry containing the following information.

                    • value (dict) --

                      The value of the asset property.

                      • stringValue (string) --

                        Optional. The string value of the value entry. Accepts substitution templates.

                      • integerValue (string) --

                        Optional. A string that contains the integer value of the value entry. Accepts substitution templates.

                      • doubleValue (string) --

                        Optional. A string that contains the double value of the value entry. Accepts substitution templates.

                      • booleanValue (string) --

                        Optional. A string that contains the boolean value ( true or false) of the value entry. Accepts substitution templates.

                    • timestamp (dict) --

                      The asset property value timestamp.

                      • timeInSeconds (string) --

                        A string that contains the time in seconds since epoch. Accepts substitution templates.

                      • offsetInNanos (string) --

                        Optional. A string that contains the nanosecond time offset. Accepts substitution templates.

                    • quality (string) --

                      Optional. A string that describes the quality of the value. Accepts substitution templates. Must be GOOD, BAD, or UNCERTAIN.

            • roleArn (string) --

              The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. ( "Action": "iotsitewise:BatchPutAssetPropertyValue"). The trust policy can restrict access to specific asset hierarchy paths.

          • stepFunctions (dict) --

            Starts execution of a Step Functions state machine.

            • executionNamePrefix (string) --

              (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.

            • stateMachineName (string) --

              The name of the Step Functions state machine whose execution will be started.

            • roleArn (string) --

              The ARN of the role that grants IoT permission to start execution of a state machine ("Action":"states:StartExecution").

          • timestream (dict) --

            The Timestream rule action writes attributes (measures) from an MQTT message into an Amazon Timestream table. For more information, see the Timestream topic rule action documentation.

            • roleArn (string) --

              The ARN of the role that grants permission to write to the Amazon Timestream database table.

            • databaseName (string) --

              The name of an Amazon Timestream database.

            • tableName (string) --

              The name of the database table into which to write the measure records.

            • dimensions (list) --

              Metadata attributes of the time series that are written in each measure record.

              • (dict) --

                Metadata attributes of the time series that are written in each measure record.

                • name (string) --

                  The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.

                  Dimensions cannot be named: measure_name, measure_value, or time. These names are reserved. Dimension names cannot start with ts_ or measure_value and they cannot contain the colon ( :) character.

                • value (string) --

                  The value to write in this column of the database record.

            • timestamp (dict) --

              Specifies an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column.

              You can use this property to specify the value and the precision of the Timestream record's timestamp. You can specify a value from the message payload or a value computed by a substitution template.

              If omitted, the topic rule action assigns the timestamp, in milliseconds, at the time it processed the rule.

              • value (string) --

                An expression that returns a long epoch time value.

              • unit (string) --

                The precision of the timestamp value that results from the expression described in value.

                Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

          • http (dict) --

            Send data to an HTTPS endpoint.

            • url (string) --

              The endpoint URL. If substitution templates are used in the URL, you must also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination is created if possible.

            • confirmationUrl (string) --

              The URL to which IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.

            • headers (list) --

              The HTTP headers to send with the message data.

              • (dict) --

                The HTTP action header.

                • key (string) --

                  The HTTP header key.

                • value (string) --

                  The HTTP header value. Substitution templates are supported.

            • auth (dict) --

              The authentication method to use when sending data to an HTTPS endpoint.

              • sigv4 (dict) --

                Use Sig V4 authorization. For more information, see Signature Version 4 Signing Process.

                • signingRegion (string) --

                  The signing region.

                • serviceName (string) --

                  The service name to use while signing with Sig V4.

                • roleArn (string) --

                  The ARN of the signing role.

          • kafka (dict) --

            Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.

            • destinationArn (string) --

              The ARN of Kafka action's VPC TopicRuleDestination.

            • topic (string) --

              The Kafka topic for messages to be sent to the Kafka broker.

            • key (string) --

              The Kafka message key.

            • partition (string) --

              The Kafka message partition.

            • clientProperties (dict) --

              Properties of the Apache Kafka producer client.

              • (string) --

                • (string) --

          • openSearch (dict) --

            Write data to an Amazon OpenSearch Service domain.

            • roleArn (string) --

              The IAM role ARN that has access to OpenSearch.

            • endpoint (string) --

              The endpoint of your OpenSearch domain.

            • index (string) --

              The OpenSearch index where you want to store your data.

            • type (string) --

              The type of document you are storing.

            • id (string) --

              The unique identifier for the document you are storing.

          • location (dict) --

            The Amazon Location Service rule action sends device location updates from an MQTT message to an Amazon Location tracker resource.

            • roleArn (string) --

              The IAM role that grants permission to write to the Amazon Location resource.

            • trackerName (string) --

              The name of the tracker resource in Amazon Location in which the location is updated.

            • deviceId (string) --

              The unique ID of the device providing the location data.

            • timestamp (dict) --

              The time that the location data was sampled. The default value is the time the MQTT message was processed.

              • value (string) --

                An expression that returns a long epoch time value.

              • unit (string) --

                The precision of the timestamp value that results from the expression described in value.

                Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

            • latitude (string) --

              A string that evaluates to a double value that represents the latitude of the device's location.

            • longitude (string) --

              A string that evaluates to a double value that represents the longitude of the device's location.

      • ruleDisabled (boolean) --

        Specifies whether the rule is disabled.

      • awsIotSqlVersion (string) --

        The version of the SQL rules engine to use when evaluating the rule.

      • errorAction (dict) --

        The action to perform when an error occurs.

        • dynamoDB (dict) --

          Write to a DynamoDB table.

          • tableName (string) --

            The name of the DynamoDB table.

          • roleArn (string) --

            The ARN of the IAM role that grants access to the DynamoDB table.

          • operation (string) --

            The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

          • hashKeyField (string) --

            The hash key name.

          • hashKeyValue (string) --

            The hash key value.

          • hashKeyType (string) --

            The hash key type. Valid values are "STRING" or "NUMBER"

          • rangeKeyField (string) --

            The range key name.

          • rangeKeyValue (string) --

            The range key value.

          • rangeKeyType (string) --

            The range key type. Valid values are "STRING" or "NUMBER"

          • payloadField (string) --

            The action payload. This name can be customized.

        • dynamoDBv2 (dict) --

          Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

          • roleArn (string) --

            The ARN of the IAM role that grants access to the DynamoDB table.

          • putItem (dict) --

            Specifies the DynamoDB table to which the message data will be written. For example:

            { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

            Each attribute in the message payload will be written to a separate column in the DynamoDB database.

            • tableName (string) --

              The table where the message data will be written.

        • lambda (dict) --

          Invoke a Lambda function.

          • functionArn (string) --

            The ARN of the Lambda function.

        • sns (dict) --

          Publish to an Amazon SNS topic.

          • targetArn (string) --

            The ARN of the SNS topic.

          • roleArn (string) --

            The ARN of the IAM role that grants access.

          • messageFormat (string) --

            (Optional) The message format of the message to publish. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see https://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

        • sqs (dict) --

          Publish to an Amazon SQS queue.

          • roleArn (string) --

            The ARN of the IAM role that grants access.

          • queueUrl (string) --

            The URL of the Amazon SQS queue.

          • useBase64 (boolean) --

            Specifies whether to use Base64 encoding.

        • kinesis (dict) --

          Write data to an Amazon Kinesis stream.

          • roleArn (string) --

            The ARN of the IAM role that grants access to the Amazon Kinesis stream.

          • streamName (string) --

            The name of the Amazon Kinesis stream.

          • partitionKey (string) --

            The partition key.

        • republish (dict) --

          Publish to another MQTT topic.

          • roleArn (string) --

            The ARN of the IAM role that grants access.

          • topic (string) --

            The name of the MQTT topic.

          • qos (integer) --

            The Quality of Service (QoS) level to use when republishing messages. The default value is 0.

          • headers (dict) --

            MQTT Version 5.0 headers information. For more information, see MQTT from the Amazon Web Services IoT Core Developer Guide.

            • payloadFormatIndicator (string) --

              An Enum string value that indicates whether the payload is formatted as UTF-8.

              Valid values are UNSPECIFIED_BYTES and UTF8_DATA.

              For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.

              Supports substitution templates.

            • contentType (string) --

              A UTF-8 encoded string that describes the content of the publishing message.

              For more information, see Content Type from the MQTT Version 5.0 specification.

              Supports substitution templates.

            • responseTopic (string) --

              A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

              For more information, see Response Topic from the MQTT Version 5.0 specification.

              Supports substitution templates.

            • correlationData (string) --

              The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received.

              For more information, see Correlation Data from the MQTT Version 5.0 specification.

              Supports substitution templates.

            • messageExpiry (string) --

              A user-defined integer value that will persist a message at the message broker for a specified amount of time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of messageExpiry represents the number of seconds before it expires. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.

              Supports substitution templates.

            • userProperties (list) --

              An array of key-value pairs that you define in the MQTT5 header.

              • (dict) --

                A key-value pair that you define in the header. Both the key and the value are either literal strings or valid substitution templates.

                • key (string) --

                  A key to be specified in UserProperty.

                • value (string) --

                  A value to be specified in UserProperty.

        • s3 (dict) --

          Write to an Amazon S3 bucket.

          • roleArn (string) --

            The ARN of the IAM role that grants access.

          • bucketName (string) --

            The Amazon S3 bucket.

          • key (string) --

            The object key. For more information, see Actions, resources, and condition keys for Amazon S3.

          • cannedAcl (string) --

            The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

        • firehose (dict) --

          Write to an Amazon Kinesis Firehose stream.

          • roleArn (string) --

            The IAM role that grants access to the Amazon Kinesis Firehose stream.

          • deliveryStreamName (string) --

            The delivery stream name.

          • separator (string) --

            A character separator that will be used to separate records written to the Firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

          • batchMode (boolean) --

            Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. The default value is false.

            When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

        • cloudwatchMetric (dict) --

          Capture a CloudWatch metric.

          • roleArn (string) --

            The IAM role that allows access to the CloudWatch metric.

          • metricNamespace (string) --

            The CloudWatch metric namespace name.

          • metricName (string) --

            The CloudWatch metric name.

          • metricValue (string) --

            The CloudWatch metric value.

          • metricUnit (string) --

            The metric unit supported by CloudWatch.

          • metricTimestamp (string) --

            An optional Unix timestamp.

        • cloudwatchAlarm (dict) --

          Change the state of a CloudWatch alarm.

          • roleArn (string) --

            The IAM role that allows access to the CloudWatch alarm.

          • alarmName (string) --

            The CloudWatch alarm name.

          • stateReason (string) --

            The reason for the alarm change.

          • stateValue (string) --

            The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

        • cloudwatchLogs (dict) --

          Send data to CloudWatch Logs.

          • roleArn (string) --

            The IAM role that allows access to the CloudWatch log.

          • logGroupName (string) --

            The CloudWatch log group to which the action sends data.

        • elasticsearch (dict) --

          Write data to an Amazon OpenSearch Service domain.

          • roleArn (string) --

            The IAM role ARN that has access to OpenSearch.

          • endpoint (string) --

            The endpoint of your OpenSearch domain.

          • index (string) --

            The index where you want to store your data.

          • type (string) --

            The type of document you are storing.

          • id (string) --

            The unique identifier for the document you are storing.

        • salesforce (dict) --

          Send a message to a Salesforce IoT Cloud Input Stream.

          • token (string) --

            The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

          • url (string) --

            The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

        • iotAnalytics (dict) --

          Sends message data to an IoT Analytics channel.

          • channelArn (string) --

            (deprecated) The ARN of the IoT Analytics channel to which message data will be sent.

          • channelName (string) --

            The name of the IoT Analytics channel to which message data will be sent.

          • batchMode (boolean) --

            Whether to process the action as a batch. The default value is false.

            When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by BatchPutMessage to the IoT Analytics channel. The resulting array can't have more than 100 messages.

          • roleArn (string) --

            The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).

        • iotEvents (dict) --

          Sends an input to an IoT Events detector.

          • inputName (string) --

            The name of the IoT Events input.

          • messageId (string) --

            The ID of the message. The default messageId is a new UUID value.

            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 IoT Events detector.

          • batchMode (boolean) --

            Whether to process the event actions as a batch. The default value is false.

            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 it's sent to IoT Events by calling BatchPutMessage. The resulting array can't have more than 10 messages.

          • roleArn (string) --

            The ARN of the role that grants IoT permission to send an input to an IoT Events detector. ("Action":"iotevents:BatchPutMessage").

        • iotSiteWise (dict) --

          Sends data from the MQTT message that triggered the rule to IoT SiteWise asset properties.

          • putAssetPropertyValueEntries (list) --

            A list of asset property value entries.

            • (dict) --

              An asset property value entry containing the following information.

              • entryId (string) --

                Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.

              • assetId (string) --

                The ID of the IoT SiteWise asset. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

              • propertyId (string) --

                The ID of the asset's property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

              • propertyAlias (string) --

                The name of the property alias associated with your asset property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

              • propertyValues (list) --

                A list of property values to insert that each contain timestamp, quality, and value (TQV) information.

                • (dict) --

                  An asset property value entry containing the following information.

                  • value (dict) --

                    The value of the asset property.

                    • stringValue (string) --

                      Optional. The string value of the value entry. Accepts substitution templates.

                    • integerValue (string) --

                      Optional. A string that contains the integer value of the value entry. Accepts substitution templates.

                    • doubleValue (string) --

                      Optional. A string that contains the double value of the value entry. Accepts substitution templates.

                    • booleanValue (string) --

                      Optional. A string that contains the boolean value ( true or false) of the value entry. Accepts substitution templates.

                  • timestamp (dict) --

                    The asset property value timestamp.

                    • timeInSeconds (string) --

                      A string that contains the time in seconds since epoch. Accepts substitution templates.

                    • offsetInNanos (string) --

                      Optional. A string that contains the nanosecond time offset. Accepts substitution templates.

                  • quality (string) --

                    Optional. A string that describes the quality of the value. Accepts substitution templates. Must be GOOD, BAD, or UNCERTAIN.

          • roleArn (string) --

            The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. ( "Action": "iotsitewise:BatchPutAssetPropertyValue"). The trust policy can restrict access to specific asset hierarchy paths.

        • stepFunctions (dict) --

          Starts execution of a Step Functions state machine.

          • executionNamePrefix (string) --

            (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.

          • stateMachineName (string) --

            The name of the Step Functions state machine whose execution will be started.

          • roleArn (string) --

            The ARN of the role that grants IoT permission to start execution of a state machine ("Action":"states:StartExecution").

        • timestream (dict) --

          The Timestream rule action writes attributes (measures) from an MQTT message into an Amazon Timestream table. For more information, see the Timestream topic rule action documentation.

          • roleArn (string) --

            The ARN of the role that grants permission to write to the Amazon Timestream database table.

          • databaseName (string) --

            The name of an Amazon Timestream database.

          • tableName (string) --

            The name of the database table into which to write the measure records.

          • dimensions (list) --

            Metadata attributes of the time series that are written in each measure record.

            • (dict) --

              Metadata attributes of the time series that are written in each measure record.

              • name (string) --

                The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.

                Dimensions cannot be named: measure_name, measure_value, or time. These names are reserved. Dimension names cannot start with ts_ or measure_value and they cannot contain the colon ( :) character.

              • value (string) --

                The value to write in this column of the database record.

          • timestamp (dict) --

            Specifies an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column.

            You can use this property to specify the value and the precision of the Timestream record's timestamp. You can specify a value from the message payload or a value computed by a substitution template.

            If omitted, the topic rule action assigns the timestamp, in milliseconds, at the time it processed the rule.

            • value (string) --

              An expression that returns a long epoch time value.

            • unit (string) --

              The precision of the timestamp value that results from the expression described in value.

              Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

        • http (dict) --

          Send data to an HTTPS endpoint.

          • url (string) --

            The endpoint URL. If substitution templates are used in the URL, you must also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination is created if possible.

          • confirmationUrl (string) --

            The URL to which IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.

          • headers (list) --

            The HTTP headers to send with the message data.

            • (dict) --

              The HTTP action header.

              • key (string) --

                The HTTP header key.

              • value (string) --

                The HTTP header value. Substitution templates are supported.

          • auth (dict) --

            The authentication method to use when sending data to an HTTPS endpoint.

            • sigv4 (dict) --

              Use Sig V4 authorization. For more information, see Signature Version 4 Signing Process.

              • signingRegion (string) --

                The signing region.

              • serviceName (string) --

                The service name to use while signing with Sig V4.

              • roleArn (string) --

                The ARN of the signing role.

        • kafka (dict) --

          Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.

          • destinationArn (string) --

            The ARN of Kafka action's VPC TopicRuleDestination.

          • topic (string) --

            The Kafka topic for messages to be sent to the Kafka broker.

          • key (string) --

            The Kafka message key.

          • partition (string) --

            The Kafka message partition.

          • clientProperties (dict) --

            Properties of the Apache Kafka producer client.

            • (string) --

              • (string) --

        • openSearch (dict) --

          Write data to an Amazon OpenSearch Service domain.

          • roleArn (string) --

            The IAM role ARN that has access to OpenSearch.

          • endpoint (string) --

            The endpoint of your OpenSearch domain.

          • index (string) --

            The OpenSearch index where you want to store your data.

          • type (string) --

            The type of document you are storing.

          • id (string) --

            The unique identifier for the document you are storing.

        • location (dict) --

          The Amazon Location Service rule action sends device location updates from an MQTT message to an Amazon Location tracker resource.

          • roleArn (string) --

            The IAM role that grants permission to write to the Amazon Location resource.

          • trackerName (string) --

            The name of the tracker resource in Amazon Location in which the location is updated.

          • deviceId (string) --

            The unique ID of the device providing the location data.

          • timestamp (dict) --

            The time that the location data was sampled. The default value is the time the MQTT message was processed.

            • value (string) --

              An expression that returns a long epoch time value.

            • unit (string) --

              The precision of the timestamp value that results from the expression described in value.

              Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

          • latitude (string) --

            A string that evaluates to a double value that represents the latitude of the device's location.

          • longitude (string) --

            A string that evaluates to a double value that represents the longitude of the device's location.

ListJobs (updated) Link ¶
Changes (request, response)
Request
{'status': {'SCHEDULED'}}
Response
{'jobs': {'status': {'SCHEDULED'}}}

Lists jobs.

Requires permission to access the ListJobs action.

See also: AWS API Documentation

Request Syntax

client.list_jobs(
    status='IN_PROGRESS'|'CANCELED'|'COMPLETED'|'DELETION_IN_PROGRESS'|'SCHEDULED',
    targetSelection='CONTINUOUS'|'SNAPSHOT',
    maxResults=123,
    nextToken='string',
    thingGroupName='string',
    thingGroupId='string',
    namespaceId='string'
)
type status:

string

param status:

An optional filter that lets you search for jobs that have the specified status.

type targetSelection:

string

param targetSelection:

Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.

type maxResults:

integer

param maxResults:

The maximum number of results to return per request.

type nextToken:

string

param nextToken:

The token to retrieve the next set of results.

type thingGroupName:

string

param thingGroupName:

A filter that limits the returned jobs to those for the specified group.

type thingGroupId:

string

param thingGroupId:

A filter that limits the returned jobs to those for the specified group.

type namespaceId:

string

param namespaceId:

The namespace used to indicate that a job is a customer-managed job.

When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.

$aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/

rtype:

dict

returns:

Response Syntax

{
    'jobs': [
        {
            'jobArn': 'string',
            'jobId': 'string',
            'thingGroupId': 'string',
            'targetSelection': 'CONTINUOUS'|'SNAPSHOT',
            'status': 'IN_PROGRESS'|'CANCELED'|'COMPLETED'|'DELETION_IN_PROGRESS'|'SCHEDULED',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'completedAt': datetime(2015, 1, 1),
            'isConcurrent': True|False
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • jobs (list) --

      A list of jobs.

      • (dict) --

        The job summary.

        • jobArn (string) --

          The job ARN.

        • jobId (string) --

          The unique identifier you assigned to this job when it was created.

        • thingGroupId (string) --

          The ID of the thing group.

        • targetSelection (string) --

          Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.

        • status (string) --

          The job summary status.

        • createdAt (datetime) --

          The time, in seconds since the epoch, when the job was created.

        • lastUpdatedAt (datetime) --

          The time, in seconds since the epoch, when the job was last updated.

        • completedAt (datetime) --

          The time, in seconds since the epoch, when the job completed.

        • isConcurrent (boolean) --

          Indicates whether a job is concurrent. Will be true when a job is rolling out new job executions or canceling previously created executions, otherwise false.

    • nextToken (string) --

      The token for the next set of results, or null if there are no additional results.

ReplaceTopicRule (updated) Link ¶
Changes (request)
{'topicRulePayload': {'actions': {'republish': {'headers': {'contentType': 'string',
                                                            'correlationData': 'string',
                                                            'messageExpiry': 'string',
                                                            'payloadFormatIndicator': 'string',
                                                            'responseTopic': 'string',
                                                            'userProperties': [{'key': 'string',
                                                                                'value': 'string'}]}}},
                      'errorAction': {'republish': {'headers': {'contentType': 'string',
                                                                'correlationData': 'string',
                                                                'messageExpiry': 'string',
                                                                'payloadFormatIndicator': 'string',
                                                                'responseTopic': 'string',
                                                                'userProperties': [{'key': 'string',
                                                                                    'value': 'string'}]}}}}}

Replaces the rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Requires permission to access the ReplaceTopicRule action.

See also: AWS API Documentation

Request Syntax

client.replace_topic_rule(
    ruleName='string',
    topicRulePayload={
        'sql': 'string',
        'description': 'string',
        'actions': [
            {
                'dynamoDB': {
                    'tableName': 'string',
                    'roleArn': 'string',
                    'operation': 'string',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'hashKeyType': 'STRING'|'NUMBER',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'rangeKeyType': 'STRING'|'NUMBER',
                    'payloadField': 'string'
                },
                'dynamoDBv2': {
                    'roleArn': 'string',
                    'putItem': {
                        'tableName': 'string'
                    }
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string',
                    'messageFormat': 'RAW'|'JSON'
                },
                'sqs': {
                    'roleArn': 'string',
                    'queueUrl': 'string',
                    'useBase64': True|False
                },
                'kinesis': {
                    'roleArn': 'string',
                    'streamName': 'string',
                    'partitionKey': 'string'
                },
                'republish': {
                    'roleArn': 'string',
                    'topic': 'string',
                    'qos': 123,
                    'headers': {
                        'payloadFormatIndicator': 'string',
                        'contentType': 'string',
                        'responseTopic': 'string',
                        'correlationData': 'string',
                        'messageExpiry': 'string',
                        'userProperties': [
                            {
                                'key': 'string',
                                'value': 'string'
                            },
                        ]
                    }
                },
                's3': {
                    'roleArn': 'string',
                    'bucketName': 'string',
                    'key': 'string',
                    'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
                },
                'firehose': {
                    'roleArn': 'string',
                    'deliveryStreamName': 'string',
                    'separator': 'string',
                    'batchMode': True|False
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'cloudwatchLogs': {
                    'roleArn': 'string',
                    'logGroupName': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'salesforce': {
                    'token': 'string',
                    'url': 'string'
                },
                'iotAnalytics': {
                    'channelArn': 'string',
                    'channelName': 'string',
                    'batchMode': True|False,
                    'roleArn': 'string'
                },
                'iotEvents': {
                    'inputName': 'string',
                    'messageId': 'string',
                    'batchMode': True|False,
                    'roleArn': 'string'
                },
                'iotSiteWise': {
                    'putAssetPropertyValueEntries': [
                        {
                            'entryId': 'string',
                            'assetId': 'string',
                            'propertyId': 'string',
                            'propertyAlias': 'string',
                            'propertyValues': [
                                {
                                    'value': {
                                        'stringValue': 'string',
                                        'integerValue': 'string',
                                        'doubleValue': 'string',
                                        'booleanValue': 'string'
                                    },
                                    'timestamp': {
                                        'timeInSeconds': 'string',
                                        'offsetInNanos': 'string'
                                    },
                                    'quality': 'string'
                                },
                            ]
                        },
                    ],
                    'roleArn': 'string'
                },
                'stepFunctions': {
                    'executionNamePrefix': 'string',
                    'stateMachineName': 'string',
                    'roleArn': 'string'
                },
                'timestream': {
                    'roleArn': 'string',
                    'databaseName': 'string',
                    'tableName': 'string',
                    'dimensions': [
                        {
                            'name': 'string',
                            'value': 'string'
                        },
                    ],
                    'timestamp': {
                        'value': 'string',
                        'unit': 'string'
                    }
                },
                'http': {
                    'url': 'string',
                    'confirmationUrl': 'string',
                    'headers': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ],
                    'auth': {
                        'sigv4': {
                            'signingRegion': 'string',
                            'serviceName': 'string',
                            'roleArn': 'string'
                        }
                    }
                },
                'kafka': {
                    'destinationArn': 'string',
                    'topic': 'string',
                    'key': 'string',
                    'partition': 'string',
                    'clientProperties': {
                        'string': 'string'
                    }
                },
                'openSearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'location': {
                    'roleArn': 'string',
                    'trackerName': 'string',
                    'deviceId': 'string',
                    'timestamp': {
                        'value': 'string',
                        'unit': 'string'
                    },
                    'latitude': 'string',
                    'longitude': 'string'
                }
            },
        ],
        'ruleDisabled': True|False,
        'awsIotSqlVersion': 'string',
        'errorAction': {
            'dynamoDB': {
                'tableName': 'string',
                'roleArn': 'string',
                'operation': 'string',
                'hashKeyField': 'string',
                'hashKeyValue': 'string',
                'hashKeyType': 'STRING'|'NUMBER',
                'rangeKeyField': 'string',
                'rangeKeyValue': 'string',
                'rangeKeyType': 'STRING'|'NUMBER',
                'payloadField': 'string'
            },
            'dynamoDBv2': {
                'roleArn': 'string',
                'putItem': {
                    'tableName': 'string'
                }
            },
            'lambda': {
                'functionArn': 'string'
            },
            'sns': {
                'targetArn': 'string',
                'roleArn': 'string',
                'messageFormat': 'RAW'|'JSON'
            },
            'sqs': {
                'roleArn': 'string',
                'queueUrl': 'string',
                'useBase64': True|False
            },
            'kinesis': {
                'roleArn': 'string',
                'streamName': 'string',
                'partitionKey': 'string'
            },
            'republish': {
                'roleArn': 'string',
                'topic': 'string',
                'qos': 123,
                'headers': {
                    'payloadFormatIndicator': 'string',
                    'contentType': 'string',
                    'responseTopic': 'string',
                    'correlationData': 'string',
                    'messageExpiry': 'string',
                    'userProperties': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ]
                }
            },
            's3': {
                'roleArn': 'string',
                'bucketName': 'string',
                'key': 'string',
                'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
            },
            'firehose': {
                'roleArn': 'string',
                'deliveryStreamName': 'string',
                'separator': 'string',
                'batchMode': True|False
            },
            'cloudwatchMetric': {
                'roleArn': 'string',
                'metricNamespace': 'string',
                'metricName': 'string',
                'metricValue': 'string',
                'metricUnit': 'string',
                'metricTimestamp': 'string'
            },
            'cloudwatchAlarm': {
                'roleArn': 'string',
                'alarmName': 'string',
                'stateReason': 'string',
                'stateValue': 'string'
            },
            'cloudwatchLogs': {
                'roleArn': 'string',
                'logGroupName': 'string'
            },
            'elasticsearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'salesforce': {
                'token': 'string',
                'url': 'string'
            },
            'iotAnalytics': {
                'channelArn': 'string',
                'channelName': 'string',
                'batchMode': True|False,
                'roleArn': 'string'
            },
            'iotEvents': {
                'inputName': 'string',
                'messageId': 'string',
                'batchMode': True|False,
                'roleArn': 'string'
            },
            'iotSiteWise': {
                'putAssetPropertyValueEntries': [
                    {
                        'entryId': 'string',
                        'assetId': 'string',
                        'propertyId': 'string',
                        'propertyAlias': 'string',
                        'propertyValues': [
                            {
                                'value': {
                                    'stringValue': 'string',
                                    'integerValue': 'string',
                                    'doubleValue': 'string',
                                    'booleanValue': 'string'
                                },
                                'timestamp': {
                                    'timeInSeconds': 'string',
                                    'offsetInNanos': 'string'
                                },
                                'quality': 'string'
                            },
                        ]
                    },
                ],
                'roleArn': 'string'
            },
            'stepFunctions': {
                'executionNamePrefix': 'string',
                'stateMachineName': 'string',
                'roleArn': 'string'
            },
            'timestream': {
                'roleArn': 'string',
                'databaseName': 'string',
                'tableName': 'string',
                'dimensions': [
                    {
                        'name': 'string',
                        'value': 'string'
                    },
                ],
                'timestamp': {
                    'value': 'string',
                    'unit': 'string'
                }
            },
            'http': {
                'url': 'string',
                'confirmationUrl': 'string',
                'headers': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ],
                'auth': {
                    'sigv4': {
                        'signingRegion': 'string',
                        'serviceName': 'string',
                        'roleArn': 'string'
                    }
                }
            },
            'kafka': {
                'destinationArn': 'string',
                'topic': 'string',
                'key': 'string',
                'partition': 'string',
                'clientProperties': {
                    'string': 'string'
                }
            },
            'openSearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'location': {
                'roleArn': 'string',
                'trackerName': 'string',
                'deviceId': 'string',
                'timestamp': {
                    'value': 'string',
                    'unit': 'string'
                },
                'latitude': 'string',
                'longitude': 'string'
            }
        }
    }
)
type ruleName:

string

param ruleName:

[REQUIRED]

The name of the rule.

type topicRulePayload:

dict

param topicRulePayload:

[REQUIRED]

The rule payload.

  • sql (string) -- [REQUIRED]

    The SQL statement used to query the topic. For more information, see IoT SQL Reference in the IoT Developer Guide.

  • description (string) --

    The description of the rule.

  • actions (list) -- [REQUIRED]

    The actions associated with the rule.

    • (dict) --

      Describes the actions associated with a rule.

      • dynamoDB (dict) --

        Write to a DynamoDB table.

        • tableName (string) -- [REQUIRED]

          The name of the DynamoDB table.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the DynamoDB table.

        • operation (string) --

          The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

        • hashKeyField (string) -- [REQUIRED]

          The hash key name.

        • hashKeyValue (string) -- [REQUIRED]

          The hash key value.

        • hashKeyType (string) --

          The hash key type. Valid values are "STRING" or "NUMBER"

        • rangeKeyField (string) --

          The range key name.

        • rangeKeyValue (string) --

          The range key value.

        • rangeKeyType (string) --

          The range key type. Valid values are "STRING" or "NUMBER"

        • payloadField (string) --

          The action payload. This name can be customized.

      • dynamoDBv2 (dict) --

        Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the DynamoDB table.

        • putItem (dict) -- [REQUIRED]

          Specifies the DynamoDB table to which the message data will be written. For example:

          { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

          Each attribute in the message payload will be written to a separate column in the DynamoDB database.

          • tableName (string) -- [REQUIRED]

            The table where the message data will be written.

      • lambda (dict) --

        Invoke a Lambda function.

        • functionArn (string) -- [REQUIRED]

          The ARN of the Lambda function.

      • sns (dict) --

        Publish to an Amazon SNS topic.

        • targetArn (string) -- [REQUIRED]

          The ARN of the SNS topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • messageFormat (string) --

          (Optional) The message format of the message to publish. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see https://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

      • sqs (dict) --

        Publish to an Amazon SQS queue.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • queueUrl (string) -- [REQUIRED]

          The URL of the Amazon SQS queue.

        • useBase64 (boolean) --

          Specifies whether to use Base64 encoding.

      • kinesis (dict) --

        Write data to an Amazon Kinesis stream.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the Amazon Kinesis stream.

        • streamName (string) -- [REQUIRED]

          The name of the Amazon Kinesis stream.

        • partitionKey (string) --

          The partition key.

      • republish (dict) --

        Publish to another MQTT topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • topic (string) -- [REQUIRED]

          The name of the MQTT topic.

        • qos (integer) --

          The Quality of Service (QoS) level to use when republishing messages. The default value is 0.

        • headers (dict) --

          MQTT Version 5.0 headers information. For more information, see MQTT from the Amazon Web Services IoT Core Developer Guide.

          • payloadFormatIndicator (string) --

            An Enum string value that indicates whether the payload is formatted as UTF-8.

            Valid values are UNSPECIFIED_BYTES and UTF8_DATA.

            For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • contentType (string) --

            A UTF-8 encoded string that describes the content of the publishing message.

            For more information, see Content Type from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • responseTopic (string) --

            A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

            For more information, see Response Topic from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • correlationData (string) --

            The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received.

            For more information, see Correlation Data from the MQTT Version 5.0 specification.

            Supports substitution templates.

          • messageExpiry (string) --

            A user-defined integer value that will persist a message at the message broker for a specified amount of time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of messageExpiry represents the number of seconds before it expires. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.

            Supports substitution templates.

          • userProperties (list) --

            An array of key-value pairs that you define in the MQTT5 header.

            • (dict) --

              A key-value pair that you define in the header. Both the key and the value are either literal strings or valid substitution templates.

              • key (string) -- [REQUIRED]

                A key to be specified in UserProperty.

              • value (string) -- [REQUIRED]

                A value to be specified in UserProperty.

      • s3 (dict) --

        Write to an Amazon S3 bucket.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • bucketName (string) -- [REQUIRED]

          The Amazon S3 bucket.

        • key (string) -- [REQUIRED]

          The object key. For more information, see Actions, resources, and condition keys for Amazon S3.

        • cannedAcl (string) --

          The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

      • firehose (dict) --

        Write to an Amazon Kinesis Firehose stream.

        • roleArn (string) -- [REQUIRED]

          The IAM role that grants access to the Amazon Kinesis Firehose stream.

        • deliveryStreamName (string) -- [REQUIRED]

          The delivery stream name.

        • separator (string) --

          A character separator that will be used to separate records written to the Firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

        • batchMode (boolean) --

          Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. The default value is false.

          When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

      • cloudwatchMetric (dict) --

        Capture a CloudWatch metric.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch metric.

        • metricNamespace (string) -- [REQUIRED]

          The CloudWatch metric namespace name.

        • metricName (string) -- [REQUIRED]

          The CloudWatch metric name.

        • metricValue (string) -- [REQUIRED]

          The CloudWatch metric value.

        • metricUnit (string) -- [REQUIRED]

          The metric unit supported by CloudWatch.

        • metricTimestamp (string) --

          An optional Unix timestamp.

      • cloudwatchAlarm (dict) --

        Change the state of a CloudWatch alarm.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch alarm.

        • alarmName (string) -- [REQUIRED]

          The CloudWatch alarm name.

        • stateReason (string) -- [REQUIRED]

          The reason for the alarm change.

        • stateValue (string) -- [REQUIRED]

          The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

      • cloudwatchLogs (dict) --

        Send data to CloudWatch Logs.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch log.

        • logGroupName (string) -- [REQUIRED]

          The CloudWatch log group to which the action sends data.

      • elasticsearch (dict) --

        Write data to an Amazon OpenSearch Service domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to OpenSearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your OpenSearch domain.

        • index (string) -- [REQUIRED]

          The index where you want to store your data.

        • type (string) -- [REQUIRED]

          The type of document you are storing.

        • id (string) -- [REQUIRED]

          The unique identifier for the document you are storing.

      • salesforce (dict) --

        Send a message to a Salesforce IoT Cloud Input Stream.

        • token (string) -- [REQUIRED]

          The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

        • url (string) -- [REQUIRED]

          The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

      • iotAnalytics (dict) --

        Sends message data to an IoT Analytics channel.

        • channelArn (string) --

          (deprecated) The ARN of the IoT Analytics channel to which message data will be sent.

        • channelName (string) --

          The name of the IoT Analytics channel to which message data will be sent.

        • batchMode (boolean) --

          Whether to process the action as a batch. The default value is false.

          When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by BatchPutMessage to the IoT Analytics channel. The resulting array can't have more than 100 messages.

        • roleArn (string) --

          The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).

      • iotEvents (dict) --

        Sends an input to an IoT Events detector.

        • inputName (string) -- [REQUIRED]

          The name of the IoT Events input.

        • messageId (string) --

          The ID of the message. The default messageId is a new UUID value.

          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 IoT Events detector.

        • batchMode (boolean) --

          Whether to process the event actions as a batch. The default value is false.

          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 it's sent to IoT Events by calling BatchPutMessage. The resulting array can't have more than 10 messages.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants IoT permission to send an input to an IoT Events detector. ("Action":"iotevents:BatchPutMessage").

      • iotSiteWise (dict) --

        Sends data from the MQTT message that triggered the rule to IoT SiteWise asset properties.

        • putAssetPropertyValueEntries (list) -- [REQUIRED]

          A list of asset property value entries.

          • (dict) --

            An asset property value entry containing the following information.

            • entryId (string) --

              Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.

            • assetId (string) --

              The ID of the IoT SiteWise asset. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

            • propertyId (string) --

              The ID of the asset's property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

            • propertyAlias (string) --

              The name of the property alias associated with your asset property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

            • propertyValues (list) -- [REQUIRED]

              A list of property values to insert that each contain timestamp, quality, and value (TQV) information.

              • (dict) --

                An asset property value entry containing the following information.

                • value (dict) -- [REQUIRED]

                  The value of the asset property.

                  • stringValue (string) --

                    Optional. The string value of the value entry. Accepts substitution templates.

                  • integerValue (string) --

                    Optional. A string that contains the integer value of the value entry. Accepts substitution templates.

                  • doubleValue (string) --

                    Optional. A string that contains the double value of the value entry. Accepts substitution templates.

                  • booleanValue (string) --

                    Optional. A string that contains the boolean value ( true or false) of the value entry. Accepts substitution templates.

                • timestamp (dict) -- [REQUIRED]

                  The asset property value timestamp.

                  • timeInSeconds (string) -- [REQUIRED]

                    A string that contains the time in seconds since epoch. Accepts substitution templates.

                  • offsetInNanos (string) --

                    Optional. A string that contains the nanosecond time offset. Accepts substitution templates.

                • quality (string) --

                  Optional. A string that describes the quality of the value. Accepts substitution templates. Must be GOOD, BAD, or UNCERTAIN.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. ( "Action": "iotsitewise:BatchPutAssetPropertyValue"). The trust policy can restrict access to specific asset hierarchy paths.

      • stepFunctions (dict) --

        Starts execution of a Step Functions state machine.

        • executionNamePrefix (string) --

          (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.

        • stateMachineName (string) -- [REQUIRED]

          The name of the Step Functions state machine whose execution will be started.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants IoT permission to start execution of a state machine ("Action":"states:StartExecution").

      • timestream (dict) --

        The Timestream rule action writes attributes (measures) from an MQTT message into an Amazon Timestream table. For more information, see the Timestream topic rule action documentation.

        • roleArn (string) -- [REQUIRED]

          The ARN of the role that grants permission to write to the Amazon Timestream database table.

        • databaseName (string) -- [REQUIRED]

          The name of an Amazon Timestream database.

        • tableName (string) -- [REQUIRED]

          The name of the database table into which to write the measure records.

        • dimensions (list) -- [REQUIRED]

          Metadata attributes of the time series that are written in each measure record.

          • (dict) --

            Metadata attributes of the time series that are written in each measure record.

            • name (string) -- [REQUIRED]

              The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.

              Dimensions cannot be named: measure_name, measure_value, or time. These names are reserved. Dimension names cannot start with ts_ or measure_value and they cannot contain the colon ( :) character.

            • value (string) -- [REQUIRED]

              The value to write in this column of the database record.

        • timestamp (dict) --

          Specifies an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column.

          You can use this property to specify the value and the precision of the Timestream record's timestamp. You can specify a value from the message payload or a value computed by a substitution template.

          If omitted, the topic rule action assigns the timestamp, in milliseconds, at the time it processed the rule.

          • value (string) -- [REQUIRED]

            An expression that returns a long epoch time value.

          • unit (string) -- [REQUIRED]

            The precision of the timestamp value that results from the expression described in value.

            Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

      • http (dict) --

        Send data to an HTTPS endpoint.

        • url (string) -- [REQUIRED]

          The endpoint URL. If substitution templates are used in the URL, you must also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination is created if possible.

        • confirmationUrl (string) --

          The URL to which IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.

        • headers (list) --

          The HTTP headers to send with the message data.

          • (dict) --

            The HTTP action header.

            • key (string) -- [REQUIRED]

              The HTTP header key.

            • value (string) -- [REQUIRED]

              The HTTP header value. Substitution templates are supported.

        • auth (dict) --

          The authentication method to use when sending data to an HTTPS endpoint.

          • sigv4 (dict) --

            Use Sig V4 authorization. For more information, see Signature Version 4 Signing Process.

            • signingRegion (string) -- [REQUIRED]

              The signing region.

            • serviceName (string) -- [REQUIRED]

              The service name to use while signing with Sig V4.

            • roleArn (string) -- [REQUIRED]

              The ARN of the signing role.

      • kafka (dict) --

        Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.

        • destinationArn (string) -- [REQUIRED]

          The ARN of Kafka action's VPC TopicRuleDestination.

        • topic (string) -- [REQUIRED]

          The Kafka topic for messages to be sent to the Kafka broker.

        • key (string) --

          The Kafka message key.

        • partition (string) --

          The Kafka message partition.

        • clientProperties (dict) -- [REQUIRED]

          Properties of the Apache Kafka producer client.

          • (string) --

            • (string) --

      • openSearch (dict) --

        Write data to an Amazon OpenSearch Service domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to OpenSearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your OpenSearch domain.

        • index (string) -- [REQUIRED]

          The OpenSearch index where you want to store your data.

        • type (string) -- [REQUIRED]

          The type of document you are storing.

        • id (string) -- [REQUIRED]

          The unique identifier for the document you are storing.

      • location (dict) --

        The Amazon Location Service rule action sends device location updates from an MQTT message to an Amazon Location tracker resource.

        • roleArn (string) -- [REQUIRED]

          The IAM role that grants permission to write to the Amazon Location resource.

        • trackerName (string) -- [REQUIRED]

          The name of the tracker resource in Amazon Location in which the location is updated.

        • deviceId (string) -- [REQUIRED]

          The unique ID of the device providing the location data.

        • timestamp (dict) --

          The time that the location data was sampled. The default value is the time the MQTT message was processed.

          • value (string) -- [REQUIRED]

            An expression that returns a long epoch time value.

          • unit (string) --

            The precision of the timestamp value that results from the expression described in value.

            Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

        • latitude (string) -- [REQUIRED]

          A string that evaluates to a double value that represents the latitude of the device's location.

        • longitude (string) -- [REQUIRED]

          A string that evaluates to a double value that represents the longitude of the device's location.

  • ruleDisabled (boolean) --

    Specifies whether the rule is disabled.

  • awsIotSqlVersion (string) --

    The version of the SQL rules engine to use when evaluating the rule.

  • errorAction (dict) --

    The action to take when an error occurs.

    • dynamoDB (dict) --

      Write to a DynamoDB table.

      • tableName (string) -- [REQUIRED]

        The name of the DynamoDB table.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access to the DynamoDB table.

      • operation (string) --

        The type of operation to be performed. This follows the substitution template, so it can be ${operation}, but the substitution must result in one of the following: INSERT, UPDATE, or DELETE.

      • hashKeyField (string) -- [REQUIRED]

        The hash key name.

      • hashKeyValue (string) -- [REQUIRED]

        The hash key value.

      • hashKeyType (string) --

        The hash key type. Valid values are "STRING" or "NUMBER"

      • rangeKeyField (string) --

        The range key name.

      • rangeKeyValue (string) --

        The range key value.

      • rangeKeyType (string) --

        The range key type. Valid values are "STRING" or "NUMBER"

      • payloadField (string) --

        The action payload. This name can be customized.

    • dynamoDBv2 (dict) --

      Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access to the DynamoDB table.

      • putItem (dict) -- [REQUIRED]

        Specifies the DynamoDB table to which the message data will be written. For example:

        { "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }

        Each attribute in the message payload will be written to a separate column in the DynamoDB database.

        • tableName (string) -- [REQUIRED]

          The table where the message data will be written.

    • lambda (dict) --

      Invoke a Lambda function.

      • functionArn (string) -- [REQUIRED]

        The ARN of the Lambda function.

    • sns (dict) --

      Publish to an Amazon SNS topic.

      • targetArn (string) -- [REQUIRED]

        The ARN of the SNS topic.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • messageFormat (string) --

        (Optional) The message format of the message to publish. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see https://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

    • sqs (dict) --

      Publish to an Amazon SQS queue.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • queueUrl (string) -- [REQUIRED]

        The URL of the Amazon SQS queue.

      • useBase64 (boolean) --

        Specifies whether to use Base64 encoding.

    • kinesis (dict) --

      Write data to an Amazon Kinesis stream.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access to the Amazon Kinesis stream.

      • streamName (string) -- [REQUIRED]

        The name of the Amazon Kinesis stream.

      • partitionKey (string) --

        The partition key.

    • republish (dict) --

      Publish to another MQTT topic.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • topic (string) -- [REQUIRED]

        The name of the MQTT topic.

      • qos (integer) --

        The Quality of Service (QoS) level to use when republishing messages. The default value is 0.

      • headers (dict) --

        MQTT Version 5.0 headers information. For more information, see MQTT from the Amazon Web Services IoT Core Developer Guide.

        • payloadFormatIndicator (string) --

          An Enum string value that indicates whether the payload is formatted as UTF-8.

          Valid values are UNSPECIFIED_BYTES and UTF8_DATA.

          For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • contentType (string) --

          A UTF-8 encoded string that describes the content of the publishing message.

          For more information, see Content Type from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • responseTopic (string) --

          A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to describe the topic which the receiver should publish to as part of the request-response flow. The topic must not contain wildcard characters.

          For more information, see Response Topic from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • correlationData (string) --

          The base64-encoded binary data used by the sender of the request message to identify which request the response message is for when it's received.

          For more information, see Correlation Data from the MQTT Version 5.0 specification.

          Supports substitution templates.

        • messageExpiry (string) --

          A user-defined integer value that will persist a message at the message broker for a specified amount of time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of messageExpiry represents the number of seconds before it expires. For more information about the limits of messageExpiry, see Amazon Web Services IoT Core message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.

          Supports substitution templates.

        • userProperties (list) --

          An array of key-value pairs that you define in the MQTT5 header.

          • (dict) --

            A key-value pair that you define in the header. Both the key and the value are either literal strings or valid substitution templates.

            • key (string) -- [REQUIRED]

              A key to be specified in UserProperty.

            • value (string) -- [REQUIRED]

              A value to be specified in UserProperty.

    • s3 (dict) --

      Write to an Amazon S3 bucket.

      • roleArn (string) -- [REQUIRED]

        The ARN of the IAM role that grants access.

      • bucketName (string) -- [REQUIRED]

        The Amazon S3 bucket.

      • key (string) -- [REQUIRED]

        The object key. For more information, see Actions, resources, and condition keys for Amazon S3.

      • cannedAcl (string) --

        The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs.

    • firehose (dict) --

      Write to an Amazon Kinesis Firehose stream.

      • roleArn (string) -- [REQUIRED]

        The IAM role that grants access to the Amazon Kinesis Firehose stream.

      • deliveryStreamName (string) -- [REQUIRED]

        The delivery stream name.

      • separator (string) --

        A character separator that will be used to separate records written to the Firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

      • batchMode (boolean) --

        Whether to deliver the Kinesis Data Firehose stream as a batch by using PutRecordBatch. The default value is false.

        When batchMode is true and the rule's SQL statement evaluates to an Array, each Array element forms one record in the PutRecordBatch request. The resulting array can't have more than 500 records.

    • cloudwatchMetric (dict) --

      Capture a CloudWatch metric.

      • roleArn (string) -- [REQUIRED]

        The IAM role that allows access to the CloudWatch metric.

      • metricNamespace (string) -- [REQUIRED]

        The CloudWatch metric namespace name.

      • metricName (string) -- [REQUIRED]

        The CloudWatch metric name.

      • metricValue (string) -- [REQUIRED]

        The CloudWatch metric value.

      • metricUnit (string) -- [REQUIRED]

        The metric unit supported by CloudWatch.

      • metricTimestamp (string) --

        An optional Unix timestamp.

    • cloudwatchAlarm (dict) --

      Change the state of a CloudWatch alarm.

      • roleArn (string) -- [REQUIRED]

        The IAM role that allows access to the CloudWatch alarm.

      • alarmName (string) -- [REQUIRED]

        The CloudWatch alarm name.

      • stateReason (string) -- [REQUIRED]

        The reason for the alarm change.

      • stateValue (string) -- [REQUIRED]

        The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

    • cloudwatchLogs (dict) --

      Send data to CloudWatch Logs.

      • roleArn (string) -- [REQUIRED]

        The IAM role that allows access to the CloudWatch log.

      • logGroupName (string) -- [REQUIRED]

        The CloudWatch log group to which the action sends data.

    • elasticsearch (dict) --

      Write data to an Amazon OpenSearch Service domain.

      • roleArn (string) -- [REQUIRED]

        The IAM role ARN that has access to OpenSearch.

      • endpoint (string) -- [REQUIRED]

        The endpoint of your OpenSearch domain.

      • index (string) -- [REQUIRED]

        The index where you want to store your data.

      • type (string) -- [REQUIRED]

        The type of document you are storing.

      • id (string) -- [REQUIRED]

        The unique identifier for the document you are storing.

    • salesforce (dict) --

      Send a message to a Salesforce IoT Cloud Input Stream.

      • token (string) -- [REQUIRED]

        The token used to authenticate access to the Salesforce IoT Cloud Input Stream. The token is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

      • url (string) -- [REQUIRED]

        The URL exposed by the Salesforce IoT Cloud Input Stream. The URL is available from the Salesforce IoT Cloud platform after creation of the Input Stream.

    • iotAnalytics (dict) --

      Sends message data to an IoT Analytics channel.

      • channelArn (string) --

        (deprecated) The ARN of the IoT Analytics channel to which message data will be sent.

      • channelName (string) --

        The name of the IoT Analytics channel to which message data will be sent.

      • batchMode (boolean) --

        Whether to process the action as a batch. The default value is false.

        When batchMode is true and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by BatchPutMessage to the IoT Analytics channel. The resulting array can't have more than 100 messages.

      • roleArn (string) --

        The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).

    • iotEvents (dict) --

      Sends an input to an IoT Events detector.

      • inputName (string) -- [REQUIRED]

        The name of the IoT Events input.

      • messageId (string) --

        The ID of the message. The default messageId is a new UUID value.

        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 IoT Events detector.

      • batchMode (boolean) --

        Whether to process the event actions as a batch. The default value is false.

        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 it's sent to IoT Events by calling BatchPutMessage. The resulting array can't have more than 10 messages.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants IoT permission to send an input to an IoT Events detector. ("Action":"iotevents:BatchPutMessage").

    • iotSiteWise (dict) --

      Sends data from the MQTT message that triggered the rule to IoT SiteWise asset properties.

      • putAssetPropertyValueEntries (list) -- [REQUIRED]

        A list of asset property value entries.

        • (dict) --

          An asset property value entry containing the following information.

          • entryId (string) --

            Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.

          • assetId (string) --

            The ID of the IoT SiteWise asset. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

          • propertyId (string) --

            The ID of the asset's property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

          • propertyAlias (string) --

            The name of the property alias associated with your asset property. You must specify either a propertyAlias or both an aliasId and a propertyId. Accepts substitution templates.

          • propertyValues (list) -- [REQUIRED]

            A list of property values to insert that each contain timestamp, quality, and value (TQV) information.

            • (dict) --

              An asset property value entry containing the following information.

              • value (dict) -- [REQUIRED]

                The value of the asset property.

                • stringValue (string) --

                  Optional. The string value of the value entry. Accepts substitution templates.

                • integerValue (string) --

                  Optional. A string that contains the integer value of the value entry. Accepts substitution templates.

                • doubleValue (string) --

                  Optional. A string that contains the double value of the value entry. Accepts substitution templates.

                • booleanValue (string) --

                  Optional. A string that contains the boolean value ( true or false) of the value entry. Accepts substitution templates.

              • timestamp (dict) -- [REQUIRED]

                The asset property value timestamp.

                • timeInSeconds (string) -- [REQUIRED]

                  A string that contains the time in seconds since epoch. Accepts substitution templates.

                • offsetInNanos (string) --

                  Optional. A string that contains the nanosecond time offset. Accepts substitution templates.

              • quality (string) --

                Optional. A string that describes the quality of the value. Accepts substitution templates. Must be GOOD, BAD, or UNCERTAIN.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants IoT permission to send an asset property value to IoT SiteWise. ( "Action": "iotsitewise:BatchPutAssetPropertyValue"). The trust policy can restrict access to specific asset hierarchy paths.

    • stepFunctions (dict) --

      Starts execution of a Step Functions state machine.

      • executionNamePrefix (string) --

        (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.

      • stateMachineName (string) -- [REQUIRED]

        The name of the Step Functions state machine whose execution will be started.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants IoT permission to start execution of a state machine ("Action":"states:StartExecution").

    • timestream (dict) --

      The Timestream rule action writes attributes (measures) from an MQTT message into an Amazon Timestream table. For more information, see the Timestream topic rule action documentation.

      • roleArn (string) -- [REQUIRED]

        The ARN of the role that grants permission to write to the Amazon Timestream database table.

      • databaseName (string) -- [REQUIRED]

        The name of an Amazon Timestream database.

      • tableName (string) -- [REQUIRED]

        The name of the database table into which to write the measure records.

      • dimensions (list) -- [REQUIRED]

        Metadata attributes of the time series that are written in each measure record.

        • (dict) --

          Metadata attributes of the time series that are written in each measure record.

          • name (string) -- [REQUIRED]

            The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.

            Dimensions cannot be named: measure_name, measure_value, or time. These names are reserved. Dimension names cannot start with ts_ or measure_value and they cannot contain the colon ( :) character.

          • value (string) -- [REQUIRED]

            The value to write in this column of the database record.

      • timestamp (dict) --

        Specifies an application-defined value to replace the default value assigned to the Timestream record's timestamp in the time column.

        You can use this property to specify the value and the precision of the Timestream record's timestamp. You can specify a value from the message payload or a value computed by a substitution template.

        If omitted, the topic rule action assigns the timestamp, in milliseconds, at the time it processed the rule.

        • value (string) -- [REQUIRED]

          An expression that returns a long epoch time value.

        • unit (string) -- [REQUIRED]

          The precision of the timestamp value that results from the expression described in value.

          Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

    • http (dict) --

      Send data to an HTTPS endpoint.

      • url (string) -- [REQUIRED]

        The endpoint URL. If substitution templates are used in the URL, you must also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination is created if possible.

      • confirmationUrl (string) --

        The URL to which IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.

      • headers (list) --

        The HTTP headers to send with the message data.

        • (dict) --

          The HTTP action header.

          • key (string) -- [REQUIRED]

            The HTTP header key.

          • value (string) -- [REQUIRED]

            The HTTP header value. Substitution templates are supported.

      • auth (dict) --

        The authentication method to use when sending data to an HTTPS endpoint.

        • sigv4 (dict) --

          Use Sig V4 authorization. For more information, see Signature Version 4 Signing Process.

          • signingRegion (string) -- [REQUIRED]

            The signing region.

          • serviceName (string) -- [REQUIRED]

            The service name to use while signing with Sig V4.

          • roleArn (string) -- [REQUIRED]

            The ARN of the signing role.

    • kafka (dict) --

      Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.

      • destinationArn (string) -- [REQUIRED]

        The ARN of Kafka action's VPC TopicRuleDestination.

      • topic (string) -- [REQUIRED]

        The Kafka topic for messages to be sent to the Kafka broker.

      • key (string) --

        The Kafka message key.

      • partition (string) --

        The Kafka message partition.

      • clientProperties (dict) -- [REQUIRED]

        Properties of the Apache Kafka producer client.

        • (string) --

          • (string) --

    • openSearch (dict) --

      Write data to an Amazon OpenSearch Service domain.

      • roleArn (string) -- [REQUIRED]

        The IAM role ARN that has access to OpenSearch.

      • endpoint (string) -- [REQUIRED]

        The endpoint of your OpenSearch domain.

      • index (string) -- [REQUIRED]

        The OpenSearch index where you want to store your data.

      • type (string) -- [REQUIRED]

        The type of document you are storing.

      • id (string) -- [REQUIRED]

        The unique identifier for the document you are storing.

    • location (dict) --

      The Amazon Location Service rule action sends device location updates from an MQTT message to an Amazon Location tracker resource.

      • roleArn (string) -- [REQUIRED]

        The IAM role that grants permission to write to the Amazon Location resource.

      • trackerName (string) -- [REQUIRED]

        The name of the tracker resource in Amazon Location in which the location is updated.

      • deviceId (string) -- [REQUIRED]

        The unique ID of the device providing the location data.

      • timestamp (dict) --

        The time that the location data was sampled. The default value is the time the MQTT message was processed.

        • value (string) -- [REQUIRED]

          An expression that returns a long epoch time value.

        • unit (string) --

          The precision of the timestamp value that results from the expression described in value.

          Valid values: SECONDS | MILLISECONDS | MICROSECONDS | NANOSECONDS. The default is MILLISECONDS.

      • latitude (string) -- [REQUIRED]

        A string that evaluates to a double value that represents the latitude of the device's location.

      • longitude (string) -- [REQUIRED]

        A string that evaluates to a double value that represents the longitude of the device's location.

returns:

None