Working with other Amazon services - Amazon IoT Events
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Working with other Amazon services

Amazon IoT Events supports the following actions that let you work with Amazon services:

  • iotTopicPublish to publish a message on an MQTT topic.

  • iotEvents to send data to Amazon IoT Events as an input value.

  • iotSiteWise to send data to an asset property in Amazon IoT SiteWise.

  • dynamoDB to send data to an Amazon DynamoDB table.

  • dynamoDBv2 to send data to an Amazon DynamoDB table.

  • firehose to send data to an Amazon Data Firehose stream.

  • lambda to invoke an Amazon Lambda function.

  • sns to send data as a push notification.

  • sqs to send data to an Amazon SQS queue.

Important
  • You must choose the same Amazon Region for both Amazon IoT Events and the Amazon services to work with. For the list of supported Regions, see Amazon IoT Events endpoints and quotas in the Amazon Web Services General Reference.

  • You must use the same Amazon Region when you create other Amazon resources for the Amazon IoT Events actions. If you switch Amazon Regions, you might have issues accessing the Amazon resources.

By default, Amazon IoT Events generates a standard payload in JSON for any action. This action payload contains all attribute-value pairs that have the information about the detector model instance and the event that triggered the action. To configure the action payload, you can use a content expression. For more information, see Expressions and the Payload data type in the Amazon IoT Events API Reference.

Amazon IoT Core

IoT topic publish action

The Amazon IoT Core action lets you publish an MQTT message through the Amazon IoT message broker. For the list of supported Regions, see Amazon IoT Core endpoints and quotas in the Amazon Web Services General Reference.

The Amazon IoT message broker connects Amazon IoT clients by sending messages from publishing clients to subscribing clients. For more information, see Message broker for Amazon IoT in the Amazon IoT Developer Guide.

More information (2)

When you publish an MQTT message, you must specify the following parameters.

mqttTopic

The MQTT topic that receives the message.

You can define an MQTT topic name dynamically at runtime using variables or input values created in the detector model.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the iot:Publish permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see IotTopicPublishAction in the Amazon IoT Events API Reference.

Amazon IoT Events

IoT Events action

The Amazon IoT Events action lets you send data to Amazon IoT Events as input. For the list of supported Regions, see Amazon IoT Events endpoints and quotas in the Amazon Web Services General Reference.

Amazon IoT Events lets you to monitor your equipment or device fleets for failures or changes in operation, and to trigger actions when such events occur. For more information, see What is Amazon IoT Events? in the Amazon IoT Events Developer Guide.

More information (2)

When you send data to Amazon IoT Events, you must specify the following parameters.

inputName

The name of the Amazon IoT Events input that receives the data.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the iotevents:BatchPutMessage permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see IotEventsAction in the Amazon IoT Events API Reference.

Amazon IoT SiteWise

IoT SiteWise action

The Amazon IoT SiteWise action lets you send data to an asset property in Amazon IoT SiteWise. For the list of supported Regions, see Amazon IoT SiteWise endpoints and quotas in the Amazon Web Services General Reference.

Amazon IoT SiteWise is a managed service that lets you collect, organize, and analyze data from industrial equipment at scale. For more information, see What is Amazon IoT SiteWise? in the Amazon IoT SiteWise User Guide.

More information (11)

When you send data to an asset property in Amazon IoT SiteWise, you must specify the following parameters.

Important

To receive the data, you must use an existing asset property in Amazon IoT SiteWise.

  • If you use the Amazon IoT Events console, you must specify propertyAlias to identify the target asset property.

  • If you use the Amazon CLI, you must specify either propertyAlias or both assetId and propertyId to identify the target asset property.

For more information, see Mapping industrial data streams to asset properties in the Amazon IoT SiteWise User Guide.

propertyAlias

(Optional) The alias of the asset property. You can also specify an expression.

assetId

(Optional) The ID of the asset that has the specified property. You can also specify an expression.

propertyId

(Optional) The ID of the asset property. You can also specify an expression.

entryId

(Optional) A unique identifier for this entry. You can use the entry ID to track which data entry causes an error in case of failure. The default is a new unique identifier. You can also specify an expression.

propertyValue

A structure that contains details about the property value.

quality

(Optional) The quality of the asset property value. The value must be GOOD, BAD, or UNCERTAIN. You can also specify an expression.

timestamp

(Optional) A structure that contains timestamp information. If you don't specify this value, the default is the event time.

timeInSeconds

The timestamp, in seconds, in the Unix epoch format. The valid range is between 1-31556889864403199. You can also specify an expression.

offsetInNanos

(Optional) The nanosecond offset converted from timeInSeconds. The valid range is between 0-999999999. You can also specify an expression.

value

A structure that contains an asset property value.

Important

You must specify one of the following value types, depending on the dataType of the specified asset property. For more information, see AssetProperty in the Amazon IoT SiteWise API Reference.

booleanValue

(Optional) The asset property value is a Boolean value that must be TRUE or FALSE. You can also specify an expression. If you use an expression, the evaluated result should be a Boolean value.

doubleValue

(Optional) The asset property value is a double. You can also specify an expression. If you use an expression, the evaluated result should be a double.

integerValue

(Optional) The asset property value is an integer. You can also specify an expression. If you use an expression, the evaluated result should be an integer.

stringValue

(Optional) The asset property value is a string. You can also specify an expression. If you use an expression, the evaluated result should be a string.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the iotsitewise:BatchPutAssetPropertyValue permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see IotSiteWiseAction in the Amazon IoT Events API Reference.

Amazon DynamoDB

DynamoDB action

The Amazon DynamoDB action lets you send data to a DynamoDB table. One column of the DynamoDB table receives all attribute-value pairs in the action payload that you specify. For the list of supported Regions, see Amazon DynamoDB endpoints and quotas in the Amazon Web Services General Reference.

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. For more information, see What is DynamoDB? in the Amazon DynamoDB Developer Guide.

More information (10)

When you send data to one column of a DynamoDB table, you must specify the following parameters.

tableName

The name of the DynamoDB table that receives the data. The tableName value must match the table name of the DynamoDB table. You can also specify an expression.

hashKeyField

The name of the hash key (also called partition key). The hashKeyField value must match the partition key of the DynamoDB table. You can also specify an expression.

hashKeyType

(Optional) The data type of the hash key. The value of the hash key type must be STRING or NUMBER. The default is STRING. You can also specify an expression.

hashKeyValue

The value of the hash key. The hashKeyValue uses substitution templates. These templates provide data at runtime. You can also specify an expression.

rangeKeyField

(Optional) The name of the range key (also called the sort key). The rangeKeyField value must match the sort key of the DynamoDB table. You can also specify an expression.

rangeKeyType

(Optional) The data type of the range key. The value of the hash key type must be STRING or NUMBER. The default is STRING. You can also specify an expression.

rangeKeyValue

(Optional) The value of the range key. The rangeKeyValue uses substitution templates. These templates provide data at runtime. You can also specify an expression.

operation

(Optional) The type of operation to perform. You can also specify an expression. The operation value must be one of the following values:

  • INSERT - Insert data as a new item into the DynamoDB table. This is the default value.

  • UPDATE - Update an existing item of the DynamoDB table with new data.

  • DELETE - Delete an existing item from the DynamoDB table.

payloadField

(Optional) The name of the DynamoDB column that receives the action payload. The default name is payload. You can also specify an expression.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

If the specified payload type is a string, DynamoDBAction sends non-JSON data to the DynamoDB table as binary data. The DynamoDB console displays the data as Base64-encoded text. The payloadField value is payload-field_raw. You can also specify an expression.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the dynamodb:PutItem permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see DynamoDBAction in the Amazon IoT Events API Reference.

Amazon DynamoDB(v2)

DynamoDBv2 action

The Amazon DynamoDB(v2) action lets you write data to a DynamoDB table. A separate column of the DynamoDB table receives one attribute-value pair in the action payload that you specify. For the list of supported Regions, see Amazon DynamoDB endpoints and quotas in the Amazon Web Services General Reference.

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. For more information, see What is DynamoDB? in the Amazon DynamoDB Developer Guide.

More information (2)

When you send data to multiple columns of a DynamoDB table, you must specify the following parameters.

tableName

The name of the DynamoDB table that receives the data. You can also specify an expression.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Important

The payload type must be JSON. You can also specify an expression.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the dynamodb:PutItem permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see DynamoDBv2Action in the Amazon IoT Events API Reference.

Amazon Data Firehose

Firehose action

The Amazon Data Firehose action lets you send data to an Firehose delivery stream. For the list of supported Regions, see Amazon Data Firehose endpoints and quotas in the Amazon Web Services General Reference.

Amazon Data Firehose is a fully managed service for delivering real-time streaming data to destinations such as Amazon Simple Storage Service (Amazon Simple Storage Service), Amazon Redshift, Amazon OpenSearch Service (OpenSearch Service), and Splunk. For more information, see What is Amazon Data Firehose? in the Amazon Data Firehose Developer Guide.

More information (3)

When you send data to an Firehose delivery stream, you must specify the following parameters.

deliveryStreamName

The name of the Firehose delivery stream that receives the data.

separator

(Optional) You can use a character separator to separate continuous data sent to the Firehose delivery stream. The separator value must be '\n'(newline), '\t' (tab), '\r\n' (Windows new line), or ',' (comma).

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the firehose:PutRecord permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see FirehoseAction in the Amazon IoT Events API Reference.

Amazon Lambda

Lambda action

The Amazon Lambda action lets you call a Lambda function. For the list of supported Regions, see Amazon Lambda endpoints and quotas in the Amazon Web Services General Reference.

Amazon Lambda is a compute service that lets you run code without provisioning or managing servers. For more information, see What is Amazon Lambda? in the Amazon Lambda Developer Guide.

More information (2)

When you call a Lambda function, you must specify the following parameters.

functionArn

The ARN of the Lambda function to call.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the lambda:InvokeFunction permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see LambdaAction in the Amazon IoT Events API Reference.

Amazon Simple Notification Service

SNS action

The Amazon SNS topic publish action lets you publish an Amazon SNS message. For the list of supported Regions, see Amazon Simple Notification Service endpoints and quotas in the Amazon Web Services General Reference.

Amazon Simple Notification Service (Amazon Simple Notification Service) is a web service that coordinates and manages the delivery or sending of messages to subscribing endpoints or clients. For more information, see What is Amazon SNS? in the Amazon Simple Notification Service Developer Guide.

Note

The Amazon SNS topic publish action doesn't support Amazon SNS FIFO (first in, first out) topics. Because the rules engine is a fully distributed service, the messages may not display in a specified order when the Amazon SNS action is initiated.

More information (2)

When you publish an Amazon SNS message, you must specify the following parameters.

targetArn

The ARN of the Amazon SNS target that receives the message.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the sns:Publish permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see SNSTopicPublishAction in the Amazon IoT Events API Reference.

Amazon Simple Queue Service

SQS action

The Amazon SQS action lets you send data to an Amazon SQS queue. For the list of supported Regions, see Amazon Simple Queue Service endpoints and quotas in the Amazon Web Services General Reference.

Amazon Simple Queue Service (Amazon SQS) offers a secure, durable, and available hosted queue that lets you integrate and decouple distributed software systems and components. For more information, see What is Amazon Simple Queue Service> in the Amazon Simple Queue Service Developer Guide.

Note

The Amazon SQS action doesn't support Amazon SQS FIFO (first in, first out) topics. Because the rules engine is a fully distributed service, the messages may not display in a specified order when the Amazon SQS action is initiated.

More information (3)

When you send data to an Amazon SQS queue, you must specify the following parameters.

queueUrl

The URL of the Amazon SQS queue that receives the data.

useBase64

(Optional) Amazon IoT Events encodes the data into Base64 text, if you specify TRUE. The default is FALSE.

payload

(Optional) The default payload contains all attribute-value pairs that have the information about the detector model instance and the event triggered the action. You can also customize the payload. For more information, see Payload in the Amazon IoT Events API Reference.

Note

Make sure that the policy attached to your Amazon IoT Events service role grants the sqs:SendMessage permission. For more information, see Identity and access management for Amazon IoT Events.

For more information, see SNSTopicPublishAction in the Amazon IoT Events API Reference.

You can also use Amazon SNS and the Amazon IoT Core rules engine to trigger an Amazon Lambda function. This makes it possible to take actions using other services, such as Amazon Connect, or even a company enterprise resource planning (ERP) application.

Note

To collect and process large streams of data records in real time, you can use other Amazon services, such as Amazon Kinesis. From there, you can complete an initial analysis and then send the results to Amazon IoT Events as an input to a detector.