AWS IoT Topic Rule
This page shows how to write Terraform and CloudFormation for AWS IoT Topic Rule and write them securely.
aws_iot_topic_rule (Terraform)
The Topic Rule in AWS IoT can be configured in Terraform with the resource name aws_iot_topic_rule
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_iot_topic_rule" "temp_analytics" {
name = "temp_analytics"
description = "Send temperature readings to DynamoDB"
enabled = true
sql = "SELECT *, timestamp() as timestamp FROM 'tempReading/bedroom'"
sql_version = "2016-03-23"
Parameters
-
arn
optional computed - string -
description
optional - string -
enabled
required - bool -
id
optional computed - string -
name
required - string -
sql
required - string -
sql_version
required - string -
tags
optional - map from string to string -
cloudwatch_alarm
set block-
alarm_name
required - string -
role_arn
required - string -
state_reason
required - string -
state_value
required - string
-
-
cloudwatch_metric
set block-
metric_name
required - string -
metric_namespace
required - string -
metric_timestamp
optional - string -
metric_unit
required - string -
metric_value
required - string -
role_arn
required - string
-
-
dynamodb
set block-
hash_key_field
required - string -
hash_key_type
optional - string -
hash_key_value
required - string -
operation
optional - string -
payload_field
optional - string -
range_key_field
optional - string -
range_key_type
optional - string -
range_key_value
optional - string -
role_arn
required - string -
table_name
required - string
-
-
dynamodbv2
set block-
role_arn
required - string -
put_item
list block-
table_name
required - string
-
-
-
elasticsearch
set block -
error_action
list block-
cloudwatch_alarm
list block-
alarm_name
required - string -
role_arn
required - string -
state_reason
required - string -
state_value
required - string
-
-
cloudwatch_metric
list block-
metric_name
required - string -
metric_namespace
required - string -
metric_timestamp
optional - string -
metric_unit
required - string -
metric_value
required - string -
role_arn
required - string
-
-
dynamodb
list block-
hash_key_field
required - string -
hash_key_type
optional - string -
hash_key_value
required - string -
operation
optional - string -
payload_field
optional - string -
range_key_field
optional - string -
range_key_type
optional - string -
range_key_value
optional - string -
role_arn
required - string -
table_name
required - string
-
-
dynamodbv2
list block-
role_arn
required - string -
put_item
list block-
table_name
required - string
-
-
-
elasticsearch
list block -
firehose
list block-
delivery_stream_name
required - string -
role_arn
required - string -
separator
optional - string
-
-
iot_analytics
list block-
channel_name
required - string -
role_arn
required - string
-
-
iot_events
list block-
input_name
required - string -
message_id
optional - string -
role_arn
required - string
-
-
kinesis
list block-
partition_key
optional - string -
role_arn
required - string -
stream_name
required - string
-
-
lambda
list block-
function_arn
required - string
-
-
republish
list block -
s3
list block-
bucket_name
required - string -
key
required - string -
role_arn
required - string
-
-
sns
list block-
message_format
optional - string -
role_arn
required - string -
target_arn
required - string
-
-
sqs
list block-
queue_url
required - string -
role_arn
required - string -
use_base64
required - bool
-
-
step_functions
list block-
execution_name_prefix
optional - string -
role_arn
required - string -
state_machine_name
required - string
-
-
-
firehose
set block-
delivery_stream_name
required - string -
role_arn
required - string -
separator
optional - string
-
-
iot_analytics
set block-
channel_name
required - string -
role_arn
required - string
-
-
iot_events
set block-
input_name
required - string -
message_id
optional - string -
role_arn
required - string
-
-
kinesis
set block-
partition_key
optional - string -
role_arn
required - string -
stream_name
required - string
-
-
lambda
set block-
function_arn
required - string
-
-
republish
set block -
s3
set block-
bucket_name
required - string -
key
required - string -
role_arn
required - string
-
-
sns
set block-
message_format
optional - string -
role_arn
required - string -
target_arn
required - string
-
-
sqs
set block-
queue_url
required - string -
role_arn
required - string -
use_base64
required - bool
-
-
step_functions
set block-
execution_name_prefix
optional - string -
role_arn
required - string -
state_machine_name
required - string
-
Explanation in Terraform Registry
AWS::IoT::TopicRule (CloudFormation)
The TopicRule in IoT can be configured in CloudFormation with the resource name AWS::IoT::TopicRule
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
RuleName
optional - String -
TopicRulePayload
required - TopicRulePayload -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
Use the
AWS::IoT::TopicRule
resource to declare an AWS IoT rule. For information about working with AWS IoT rules, see Rules for AWS IoT in the AWS IoT Developer Guide.
Frequently asked questions
What is AWS IoT Topic Rule?
AWS IoT Topic Rule is a resource for IoT of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS IoT Topic Rule?
For Terraform, the danielsiwiec/esp8266-mqtt-aws-iot-temperature source code example is useful. See the Terraform Example section for further details.