AWS IoT

2019/11/19 - AWS IoT - 6 new 3 updated api methods

Changes  As part of this release, we are extending the capability of AWS IoT Rules Engine to send messages directly to customer's own web services/applications. Customers can now create topic rules with HTTP actions to route messages from IoT Core directly to URL's that they own. Ownership is proved by creating and confirming topic rule destinations.

CreateTopicRuleDestination (new) Link ¶

Creates a topic rule destination. The destination must be confirmed prior to use.

See also: AWS API Documentation

Request Syntax

client.create_topic_rule_destination(
    destinationConfiguration={
        'httpUrlConfiguration': {
            'confirmationUrl': 'string'
        }
    }
)
type destinationConfiguration

dict

param destinationConfiguration

[REQUIRED]

The topic rule destination configuration.

  • httpUrlConfiguration (dict) --

    Configuration of the HTTP URL.

    • confirmationUrl (string) -- [REQUIRED]

      The URL AWS IoT uses to confirm ownership of or access to the topic rule destination URL.

rtype

dict

returns

Response Syntax

{
    'topicRuleDestination': {
        'arn': 'string',
        'status': 'ENABLED'|'IN_PROGRESS'|'DISABLED'|'ERROR',
        'statusReason': 'string',
        'httpUrlProperties': {
            'confirmationUrl': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • topicRuleDestination (dict) --

      The topic rule destination.

      • arn (string) --

        The topic rule destination URL.

      • status (string) --

        The status of the topic rule destination. Valid values are:

        IN_PROGRESS

        A topic rule destination was created but has not been confirmed. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

        ENABLED

        Confirmation was completed, and traffic to this destination is allowed. You can set status to DISABLED by calling UpdateTopicRuleDestination .

        DISABLED

        Confirmation was completed, and traffic to this destination is not allowed. You can set status to ENABLED by calling UpdateTopicRuleDestination .

        ERROR

        Confirmation could not be completed, for example if the confirmation timed out. You can call GetTopicRuleDestination for details about the error. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

      • statusReason (string) --

        Additional details or reason why the topic rule destination is in the current status.

      • httpUrlProperties (dict) --

        Properties of the HTTP URL.

        • confirmationUrl (string) --

          The URL used to confirm the HTTP topic rule destination URL.

ListTopicRuleDestinations (new) Link ¶

Lists all the topic rule destinations in your AWS account.

See also: AWS API Documentation

Request Syntax

client.list_topic_rule_destinations(
    maxResults=123,
    nextToken='string'
)
type maxResults

integer

param maxResults

The maximum number of results to return at one time.

type nextToken

string

param nextToken

The token to retrieve the next set of results.

rtype

dict

returns

Response Syntax

{
    'destinationSummaries': [
        {
            'arn': 'string',
            'status': 'ENABLED'|'IN_PROGRESS'|'DISABLED'|'ERROR',
            'statusReason': 'string',
            'httpUrlSummary': {
                'confirmationUrl': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • destinationSummaries (list) --

      Information about a topic rule destination.

      • (dict) --

        Information about the topic rule destination.

        • arn (string) --

          The topic rule destination ARN.

        • status (string) --

          The status of the topic rule destination. Valid values are:

          IN_PROGRESS

          A topic rule destination was created but has not been confirmed. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

          ENABLED

          Confirmation was completed, and traffic to this destination is allowed. You can set status to DISABLED by calling UpdateTopicRuleDestination .

          DISABLED

          Confirmation was completed, and traffic to this destination is not allowed. You can set status to ENABLED by calling UpdateTopicRuleDestination .

          ERROR

          Confirmation could not be completed, for example if the confirmation timed out. You can call GetTopicRuleDestination for details about the error. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

        • statusReason (string) --

          The reason the topic rule destination is in the current status.

        • httpUrlSummary (dict) --

          Information about the HTTP URL.

          • confirmationUrl (string) --

            The URL used to confirm ownership of or access to the HTTP topic rule destination URL.

    • nextToken (string) --

      The token to retrieve the next set of results.

DeleteTopicRuleDestination (new) Link ¶

Deletes a topic rule destination.

See also: AWS API Documentation

Request Syntax

client.delete_topic_rule_destination(
    arn='string'
)
type arn

string

param arn

[REQUIRED]

The ARN of the topic rule destination to delete.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

ConfirmTopicRuleDestination (new) Link ¶

Confirms a topic rule destination. When you create a rule requiring a destination, AWS IoT sends a confirmation message to the endpoint or base address you specify. The message includes a token which you pass back when calling ConfirmTopicRuleDestination to confirm that you own or have access to the endpoint.

See also: AWS API Documentation

Request Syntax

client.confirm_topic_rule_destination(
    confirmationToken='string'
)
type confirmationToken

string

param confirmationToken

[REQUIRED]

The token used to confirm ownership or access to the topic rule confirmation URL.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetTopicRuleDestination (new) Link ¶

Gets information about a topic rule destination.

See also: AWS API Documentation

Request Syntax

client.get_topic_rule_destination(
    arn='string'
)
type arn

string

param arn

[REQUIRED]

The ARN of the topic rule destination.

rtype

dict

returns

Response Syntax

{
    'topicRuleDestination': {
        'arn': 'string',
        'status': 'ENABLED'|'IN_PROGRESS'|'DISABLED'|'ERROR',
        'statusReason': 'string',
        'httpUrlProperties': {
            'confirmationUrl': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • topicRuleDestination (dict) --

      The topic rule destination.

      • arn (string) --

        The topic rule destination URL.

      • status (string) --

        The status of the topic rule destination. Valid values are:

        IN_PROGRESS

        A topic rule destination was created but has not been confirmed. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

        ENABLED

        Confirmation was completed, and traffic to this destination is allowed. You can set status to DISABLED by calling UpdateTopicRuleDestination .

        DISABLED

        Confirmation was completed, and traffic to this destination is not allowed. You can set status to ENABLED by calling UpdateTopicRuleDestination .

        ERROR

        Confirmation could not be completed, for example if the confirmation timed out. You can call GetTopicRuleDestination for details about the error. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

      • statusReason (string) --

        Additional details or reason why the topic rule destination is in the current status.

      • httpUrlProperties (dict) --

        Properties of the HTTP URL.

        • confirmationUrl (string) --

          The URL used to confirm the HTTP topic rule destination URL.

UpdateTopicRuleDestination (new) Link ¶

Updates a topic rule destination. You use this to change the status, endpoint URL, or confirmation URL of the destination.

See also: AWS API Documentation

Request Syntax

client.update_topic_rule_destination(
    arn='string',
    status='ENABLED'|'IN_PROGRESS'|'DISABLED'|'ERROR'
)
type arn

string

param arn

[REQUIRED]

The ARN of the topic rule destination.

type status

string

param status

[REQUIRED]

The status of the topic rule destination. Valid values are:

IN_PROGRESS

A topic rule destination was created but has not been confirmed. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

ENABLED

Confirmation was completed, and traffic to this destination is allowed. You can set status to DISABLED by calling UpdateTopicRuleDestination .

DISABLED

Confirmation was completed, and traffic to this destination is not allowed. You can set status to ENABLED by calling UpdateTopicRuleDestination .

ERROR

Confirmation could not be completed, for example if the confirmation timed out. You can call GetTopicRuleDestination for details about the error. You can set status to IN_PROGRESS by calling UpdateTopicRuleDestination . Calling UpdateTopicRuleDestination causes a new confirmation challenge to be sent to your confirmation endpoint.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreateTopicRule (updated) Link ¶
Changes (request)
{'topicRulePayload': {'actions': {'http': {'auth': {'sigv4': {'roleArn': 'string',
                                                              'serviceName': 'string',
                                                              'signingRegion': 'string'}},
                                           'confirmationUrl': 'string',
                                           'headers': [{'key': 'string',
                                                        'value': 'string'}],
                                           'url': 'string'}},
                      'errorAction': {'http': {'auth': {'sigv4': {'roleArn': 'string',
                                                                  'serviceName': 'string',
                                                                  'signingRegion': 'string'}},
                                               'confirmationUrl': 'string',
                                               'headers': [{'key': 'string',
                                                            'value': 'string'}],
                                               'url': '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.

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
                },
                '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'
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'salesforce': {
                    'token': 'string',
                    'url': 'string'
                },
                'iotAnalytics': {
                    'channelArn': 'string',
                    'channelName': 'string',
                    'roleArn': 'string'
                },
                'iotEvents': {
                    'inputName': 'string',
                    'messageId': 'string',
                    'roleArn': 'string'
                },
                'stepFunctions': {
                    'executionNamePrefix': 'string',
                    'stateMachineName': 'string',
                    'roleArn': 'string'
                },
                'http': {
                    'url': 'string',
                    'confirmationUrl': 'string',
                    'headers': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ],
                    'auth': {
                        'sigv4': {
                            'signingRegion': 'string',
                            'serviceName': 'string',
                            'roleArn': '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
            },
            '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'
            },
            'cloudwatchMetric': {
                'roleArn': 'string',
                'metricNamespace': 'string',
                'metricName': 'string',
                'metricValue': 'string',
                'metricUnit': 'string',
                'metricTimestamp': 'string'
            },
            'cloudwatchAlarm': {
                'roleArn': 'string',
                'alarmName': 'string',
                'stateReason': 'string',
                'stateValue': 'string'
            },
            'elasticsearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'salesforce': {
                'token': 'string',
                'url': 'string'
            },
            'iotAnalytics': {
                'channelArn': 'string',
                'channelName': 'string',
                'roleArn': 'string'
            },
            'iotEvents': {
                'inputName': 'string',
                'messageId': 'string',
                'roleArn': 'string'
            },
            'stepFunctions': {
                'executionNamePrefix': 'string',
                'stateMachineName': 'string',
                'roleArn': 'string'
            },
            'http': {
                'url': 'string',
                'confirmationUrl': 'string',
                'headers': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ],
                'auth': {
                    'sigv4': {
                        'signingRegion': 'string',
                        'serviceName': 'string',
                        'roleArn': '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 AWS IoT SQL Reference in the AWS 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.

      • 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.

        • 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).

      • 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.

      • elasticsearch (dict) --

        Write data to an Amazon Elasticsearch Service domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to Elasticsearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your Elasticsearch domain.

        • index (string) -- [REQUIRED]

          The Elasticsearch 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 AWS 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.

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

        • inputName (string) -- [REQUIRED]

          The name of the AWS IoT Events input.

        • messageId (string) --

          [Optional] Use this to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

        • roleArn (string) -- [REQUIRED]

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

      • 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").

      • 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 AWS 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 AWS 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 substituion 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.

  • 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.

    • 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.

      • 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).

    • 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.

    • elasticsearch (dict) --

      Write data to an Amazon Elasticsearch Service domain.

      • roleArn (string) -- [REQUIRED]

        The IAM role ARN that has access to Elasticsearch.

      • endpoint (string) -- [REQUIRED]

        The endpoint of your Elasticsearch domain.

      • index (string) -- [REQUIRED]

        The Elasticsearch 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 AWS 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.

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

      • inputName (string) -- [REQUIRED]

        The name of the AWS IoT Events input.

      • messageId (string) --

        [Optional] Use this to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

      • roleArn (string) -- [REQUIRED]

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

    • 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").

    • 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 AWS 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 AWS 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 substituion 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.

type tags

string

param tags

Metadata which can be used to manage the topic rule.

Note

For URI Request parameters use format: ...key1=value1&key2=value2...

For the CLI command-line parameter use format: --tags "key1=value1&key2=value2..."

For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

returns

None

GetTopicRule (updated) Link ¶
Changes (response)
{'rule': {'actions': {'http': {'auth': {'sigv4': {'roleArn': 'string',
                                                  'serviceName': 'string',
                                                  'signingRegion': 'string'}},
                               'confirmationUrl': 'string',
                               'headers': [{'key': 'string',
                                            'value': 'string'}],
                               'url': 'string'}},
          'errorAction': {'http': {'auth': {'sigv4': {'roleArn': 'string',
                                                      'serviceName': 'string',
                                                      'signingRegion': 'string'}},
                                   'confirmationUrl': 'string',
                                   'headers': [{'key': 'string',
                                                'value': 'string'}],
                                   'url': 'string'}}}}

Gets information about the rule.

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
                },
                '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'
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'salesforce': {
                    'token': 'string',
                    'url': 'string'
                },
                'iotAnalytics': {
                    'channelArn': 'string',
                    'channelName': 'string',
                    'roleArn': 'string'
                },
                'iotEvents': {
                    'inputName': 'string',
                    'messageId': 'string',
                    'roleArn': 'string'
                },
                'stepFunctions': {
                    'executionNamePrefix': 'string',
                    'stateMachineName': 'string',
                    'roleArn': 'string'
                },
                'http': {
                    'url': 'string',
                    'confirmationUrl': 'string',
                    'headers': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ],
                    'auth': {
                        'sigv4': {
                            'signingRegion': 'string',
                            'serviceName': 'string',
                            'roleArn': '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
            },
            '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'
            },
            'cloudwatchMetric': {
                'roleArn': 'string',
                'metricNamespace': 'string',
                'metricName': 'string',
                'metricValue': 'string',
                'metricUnit': 'string',
                'metricTimestamp': 'string'
            },
            'cloudwatchAlarm': {
                'roleArn': 'string',
                'alarmName': 'string',
                'stateReason': 'string',
                'stateValue': 'string'
            },
            'elasticsearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'salesforce': {
                'token': 'string',
                'url': 'string'
            },
            'iotAnalytics': {
                'channelArn': 'string',
                'channelName': 'string',
                'roleArn': 'string'
            },
            'iotEvents': {
                'inputName': 'string',
                'messageId': 'string',
                'roleArn': 'string'
            },
            'stepFunctions': {
                'executionNamePrefix': 'string',
                'stateMachineName': 'string',
                'roleArn': 'string'
            },
            'http': {
                'url': 'string',
                'confirmationUrl': 'string',
                'headers': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ],
                'auth': {
                    'sigv4': {
                        'signingRegion': 'string',
                        'serviceName': 'string',
                        'roleArn': '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.

          • 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.

            • 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).

          • 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.

          • elasticsearch (dict) --

            Write data to an Amazon Elasticsearch Service domain.

            • roleArn (string) --

              The IAM role ARN that has access to Elasticsearch.

            • endpoint (string) --

              The endpoint of your Elasticsearch domain.

            • index (string) --

              The Elasticsearch 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 AWS 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.

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

            • inputName (string) --

              The name of the AWS IoT Events input.

            • messageId (string) --

              [Optional] Use this to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

            • roleArn (string) --

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

          • 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").

          • 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 AWS 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 AWS 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 substituion 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.

      • 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.

        • 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.

          • 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).

        • 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.

        • elasticsearch (dict) --

          Write data to an Amazon Elasticsearch Service domain.

          • roleArn (string) --

            The IAM role ARN that has access to Elasticsearch.

          • endpoint (string) --

            The endpoint of your Elasticsearch domain.

          • index (string) --

            The Elasticsearch 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 AWS 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.

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

          • inputName (string) --

            The name of the AWS IoT Events input.

          • messageId (string) --

            [Optional] Use this to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

          • roleArn (string) --

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

        • 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").

        • 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 AWS 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 AWS 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 substituion 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.

ReplaceTopicRule (updated) Link ¶
Changes (request)
{'topicRulePayload': {'actions': {'http': {'auth': {'sigv4': {'roleArn': 'string',
                                                              'serviceName': 'string',
                                                              'signingRegion': 'string'}},
                                           'confirmationUrl': 'string',
                                           'headers': [{'key': 'string',
                                                        'value': 'string'}],
                                           'url': 'string'}},
                      'errorAction': {'http': {'auth': {'sigv4': {'roleArn': 'string',
                                                                  'serviceName': 'string',
                                                                  'signingRegion': 'string'}},
                                               'confirmationUrl': 'string',
                                               'headers': [{'key': 'string',
                                                            'value': 'string'}],
                                               'url': '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.

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
                },
                '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'
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                },
                'salesforce': {
                    'token': 'string',
                    'url': 'string'
                },
                'iotAnalytics': {
                    'channelArn': 'string',
                    'channelName': 'string',
                    'roleArn': 'string'
                },
                'iotEvents': {
                    'inputName': 'string',
                    'messageId': 'string',
                    'roleArn': 'string'
                },
                'stepFunctions': {
                    'executionNamePrefix': 'string',
                    'stateMachineName': 'string',
                    'roleArn': 'string'
                },
                'http': {
                    'url': 'string',
                    'confirmationUrl': 'string',
                    'headers': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ],
                    'auth': {
                        'sigv4': {
                            'signingRegion': 'string',
                            'serviceName': 'string',
                            'roleArn': '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
            },
            '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'
            },
            'cloudwatchMetric': {
                'roleArn': 'string',
                'metricNamespace': 'string',
                'metricName': 'string',
                'metricValue': 'string',
                'metricUnit': 'string',
                'metricTimestamp': 'string'
            },
            'cloudwatchAlarm': {
                'roleArn': 'string',
                'alarmName': 'string',
                'stateReason': 'string',
                'stateValue': 'string'
            },
            'elasticsearch': {
                'roleArn': 'string',
                'endpoint': 'string',
                'index': 'string',
                'type': 'string',
                'id': 'string'
            },
            'salesforce': {
                'token': 'string',
                'url': 'string'
            },
            'iotAnalytics': {
                'channelArn': 'string',
                'channelName': 'string',
                'roleArn': 'string'
            },
            'iotEvents': {
                'inputName': 'string',
                'messageId': 'string',
                'roleArn': 'string'
            },
            'stepFunctions': {
                'executionNamePrefix': 'string',
                'stateMachineName': 'string',
                'roleArn': 'string'
            },
            'http': {
                'url': 'string',
                'confirmationUrl': 'string',
                'headers': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ],
                'auth': {
                    'sigv4': {
                        'signingRegion': 'string',
                        'serviceName': 'string',
                        'roleArn': '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 AWS IoT SQL Reference in the AWS 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.

      • 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.

        • 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).

      • 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.

      • elasticsearch (dict) --

        Write data to an Amazon Elasticsearch Service domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to Elasticsearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your Elasticsearch domain.

        • index (string) -- [REQUIRED]

          The Elasticsearch 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 AWS 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.

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

        • inputName (string) -- [REQUIRED]

          The name of the AWS IoT Events input.

        • messageId (string) --

          [Optional] Use this to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

        • roleArn (string) -- [REQUIRED]

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

      • 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").

      • 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 AWS 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 AWS 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 substituion 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.

  • 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.

    • 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.

      • 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).

    • 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.

    • elasticsearch (dict) --

      Write data to an Amazon Elasticsearch Service domain.

      • roleArn (string) -- [REQUIRED]

        The IAM role ARN that has access to Elasticsearch.

      • endpoint (string) -- [REQUIRED]

        The endpoint of your Elasticsearch domain.

      • index (string) -- [REQUIRED]

        The Elasticsearch 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 AWS 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.

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

      • inputName (string) -- [REQUIRED]

        The name of the AWS IoT Events input.

      • messageId (string) --

        [Optional] Use this to ensure that only one input (message) with a given messageId will be processed by an AWS IoT Events detector.

      • roleArn (string) -- [REQUIRED]

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

    • 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").

    • 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 AWS 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 AWS 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 substituion 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.

returns

None