{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/api-evangelist/amazon-iot-events/refs/heads/main/json-schema/iot-events-alarm-action-schema.json",
"title": "AlarmAction",
"description": "Specifies one of the following actions to receive notifications when the alarm state changes.",
"type": "object",
"properties": {
"sns": {
"type": "object",
"required": [
"targetArn"
],
"properties": {
"targetArn": {
"allOf": [
{
"$ref": "#/components/schemas/AmazonResourceName"
},
{
"description": "The ARN of the Amazon SNS target where the message is sent."
}
]
},
"payload": {
"allOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"description": "You can configure the action payload when you send a message as an Amazon SNS push notification."
}
]
}
},
"description": "Information required to publish the Amazon SNS message."
},
"iotTopicPublish": {
"type": "object",
"required": [
"mqttTopic"
],
"properties": {
"mqttTopic": {
"allOf": [
{
"$ref": "#/components/schemas/MQTTTopic"
},
{
"description": "The MQTT topic of the message. You can use a string expression that includes variables ($variable.<variable-name>) and input values ($input.<input-name>.<path-to-datum>) as the topic string."
}
]
},
"payload": {
"allOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"description": "You can configure the action payload when you publish a message to an AWS IoT Core topic."
}
]
}
},
"description": "Information required to publish the MQTT message through the AWS IoT message broker."
},
"lambda": {
"type": "object",
"required": [
"functionArn"
],
"properties": {
"functionArn": {
"allOf": [
{
"$ref": "#/components/schemas/AmazonResourceName"
},
{
"description": "The ARN of the Lambda function that is executed."
}
]
},
"payload": {
"allOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"description": "You can configure the action payload when you send a message to a Lambda function."
}
]
}
},
"description": "Calls a Lambda function, passing in information about the detector model instance and the event that triggered the action."
},
"iotEvents": {
"type": "object",
"required": [
"inputName"
],
"properties": {
"inputName": {
"allOf": [
{
"$ref": "#/components/schemas/InputName"
},
{
"description": "The name of the AWS IoT Events input where the data is sent."
}
]
},
"payload": {
"allOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"description": "You can configure the action payload when you send a message to an AWS IoT Events input."
}
]
}
},
"description": "Sends an AWS IoT Events input, passing in information about the detector model instance and the event that triggered the action."
},
"sqs": {
"type": "object",
"required": [
"queueUrl"
],
"properties": {
"queueUrl": {
"allOf": [
{
"$ref": "#/components/schemas/QueueUrl"
},
{
"description": "The URL of the SQS queue where the data is written."
}
]
},
"useBase64": {
"allOf": [
{
"$ref": "#/components/schemas/UseBase64"
},
{
"description": "Set this to TRUE if you want the data to be base-64 encoded before it is written to the queue. Otherwise, set this to FALSE."
}
]
},
"payload": {
"allOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"description": "You can configure the action payload when you send a message to an Amazon SQS queue."
}
]
}
},
"description": "Sends information about the detector model instance and the event that triggered the action to an Amazon SQS queue."
},
"firehose": {
"type": "object",
"required": [
"deliveryStreamName"
],
"properties": {
"deliveryStreamName": {
"allOf": [
{
"$ref": "#/components/schemas/DeliveryStreamName"
},
{
"description": "The name of the Kinesis Data Firehose delivery stream where the data is written."
}
]
},
"separator": {
"allOf": [
{
"$ref": "#/components/schemas/FirehoseSeparator"
},
{
"description": "A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\\n' (newline), '\\t' (tab), '\\r\\n' (Windows newline), ',' (comma)."
}
]
},
"payload": {
"allOf": [
{
"$ref": "#/components/schemas/Payload"
},
{
"description": "You can configure the action payload when you send a message to an Amazon Kinesis Data Firehose delivery stream."
}
]
}
},
"description": "Sends information about the detector model instance and the event that triggered the action to an Amazon Kinesis Data Firehose delivery stream."
},
"dynamoDB": {
"type": "object",
"required": [
"hashKeyField",
"hashKeyValue",
"tableName"
],
"properties": {
"hashKeyType": {
"allOf": [
{
"$ref": "#/components/schemas/DynamoKeyType"
},
{
"description": "
The data type for the hash key (also called the partition key). You can specify the following values:
'STRING' - The hash key is a string.
'NUMBER' - The hash key is a number.
If you don't specify hashKeyType, the default value is 'STRING'.
hashKeyField value must match the partition key of the target DynamoDB table."
}
]
},
"hashKeyValue": {
"allOf": [
{
"$ref": "#/components/schemas/DynamoKeyValue"
},
{
"description": "The value of the hash key (also called the partition key)."
}
]
},
"rangeKeyType": {
"allOf": [
{
"$ref": "#/components/schemas/DynamoKeyType"
},
{
"description": "The data type for the range key (also called the sort key), You can specify the following values:
'STRING' - The range key is a string.
'NUMBER' - The range key is number.
If you don't specify rangeKeyField, the default value is 'STRING'.
rangeKeyField value must match the sort key of the target DynamoDB table. "
}
]
},
"rangeKeyValue": {
"allOf": [
{
"$ref": "#/components/schemas/DynamoKeyValue"
},
{
"description": "The value of the range key (also called the sort key)."
}
]
},
"operation": {
"allOf": [
{
"$ref": "#/components/schemas/DynamoOperation"
},
{
"description": "The type of operation to perform. You can specify the following values:
'INSERT' - Insert data as a new item into the DynamoDB table. This item uses the specified hash key as a partition key. If you specified a range key, the item uses the range key as a sort key.
'UPDATE' - Update an existing item of the DynamoDB table with new data. This item's partition key must match the specified hash key. If you specified a range key, the range key must match the item's sort key.
'DELETE' - Delete an existing item of the DynamoDB table. This item's partition key must match the specified hash key. If you specified a range key, the range key must match the item's sort key.
If you don't specify this parameter, AWS IoT Events triggers the 'INSERT' operation.
The name of the DynamoDB column that receives the action payload.
If you don't specify this parameter, the name of the DynamoDB column is payload.
tableName value must match the table name of the target DynamoDB table. "
}
]
},
"payload": {
"$ref": "#/components/schemas/Payload"
}
},
"description": "Defines an action to write to the Amazon DynamoDB table that you created. The standard action payload contains all the information about the detector model instance and the event that triggered the action. You can customize the payload. One column of the DynamoDB table receives all attribute-value pairs in the payload that you specify.
You must use expressions for all parameters in DynamoDBAction. The expressions accept literals, operators, functions, references, and substitution templates.
Examples
For literal values, the expressions must contain single quotes. For example, the value for the hashKeyType parameter can be 'STRING'.
For references, you must specify either variables or input values. For example, the value for the hashKeyField parameter can be $input.GreenhouseInput.name.
For a substitution template, you must use ${}, and the template must be in single quotes. A substitution template can also contain a combination of literals, operators, functions, references, and substitution templates.
In the following example, the value for the hashKeyValue parameter uses a substitution template.
'${$input.GreenhouseInput.temperature * 6 / 5 + 32} in Fahrenheit'
For a string concatenation, you must use +. A string concatenation can also contain a combination of literals, operators, functions, references, and substitution templates.
In the following example, the value for the tableName parameter uses a string concatenation.
'GreenhouseTemperatureTable ' + $input.GreenhouseInput.date
For more information, see Expressions in the AWS IoT Events Developer Guide.
If the defined payload type is a string, DynamoDBAction writes non-JSON data to the DynamoDB table as binary data. The DynamoDB console displays the data as Base64-encoded text. The value for the payloadField parameter is <payload-field>_raw.
Defines an action to write to the Amazon DynamoDB table that you created. The default action payload contains all the information about the detector model instance and the event that triggered the action. You can customize the payload. A separate column of the DynamoDB table receives one attribute-value pair in the payload that you specify.
You must use expressions for all parameters in DynamoDBv2Action. The expressions accept literals, operators, functions, references, and substitution templates.
Examples
For literal values, the expressions must contain single quotes. For example, the value for the tableName parameter can be 'GreenhouseTemperatureTable'.
For references, you must specify either variables or input values. For example, the value for the tableName parameter can be $variable.ddbtableName.
For a substitution template, you must use ${}, and the template must be in single quotes. A substitution template can also contain a combination of literals, operators, functions, references, and substitution templates.
In the following example, the value for the contentExpression parameter in Payload uses a substitution template.
'{\\\"sensorID\\\": \\\"${$input.GreenhouseInput.sensor_id}\\\", \\\"temperature\\\": \\\"${$input.GreenhouseInput.temperature * 9 / 5 + 32}\\\"}'
For a string concatenation, you must use +. A string concatenation can also contain a combination of literals, operators, functions, references, and substitution templates.
In the following example, the value for the tableName parameter uses a string concatenation.
'GreenhouseTemperatureTable ' + $input.GreenhouseInput.date
For more information, see Expressions in the AWS IoT Events Developer Guide.
The value for the type parameter in Payload must be JSON.
Sends information about the detector model instance and the event that triggered the action to a specified asset property in AWS IoT SiteWise.
You must use expressions for all parameters in IotSiteWiseAction. The expressions accept literals, operators, functions, references, and substitutions templates.
Examples
For literal values, the expressions must contain single quotes. For example, the value for the propertyAlias parameter can be '/company/windfarm/3/turbine/7/temperature'.
For references, you must specify either variables or input values. For example, the value for the assetId parameter can be $input.TurbineInput.assetId1.
For a substitution template, you must use ${}, and the template must be in single quotes. A substitution template can also contain a combination of literals, operators, functions, references, and substitution templates.
In the following example, the value for the propertyAlias parameter uses a substitution template.
'company/windfarm/${$input.TemperatureInput.sensorData.windfarmID}/turbine/ ${$input.TemperatureInput.sensorData.turbineID}/temperature'
You must specify either propertyAlias or both assetId and propertyId to identify the target asset property in AWS IoT SiteWise.
For more information, see Expressions in the AWS IoT Events Developer Guide.
" } } }