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
-
arnoptional computed - string -
descriptionoptional - string -
enabledrequired - bool -
idoptional computed - string -
namerequired - string -
sqlrequired - string -
sql_versionrequired - string -
tagsoptional - map from string to string -
cloudwatch_alarmset block-
alarm_namerequired - string -
role_arnrequired - string -
state_reasonrequired - string -
state_valuerequired - string
-
-
cloudwatch_metricset block-
metric_namerequired - string -
metric_namespacerequired - string -
metric_timestampoptional - string -
metric_unitrequired - string -
metric_valuerequired - string -
role_arnrequired - string
-
-
dynamodbset block-
hash_key_fieldrequired - string -
hash_key_typeoptional - string -
hash_key_valuerequired - string -
operationoptional - string -
payload_fieldoptional - string -
range_key_fieldoptional - string -
range_key_typeoptional - string -
range_key_valueoptional - string -
role_arnrequired - string -
table_namerequired - string
-
-
dynamodbv2set block-
role_arnrequired - string -
put_itemlist block-
table_namerequired - string
-
-
-
elasticsearchset block -
error_actionlist block-
cloudwatch_alarmlist block-
alarm_namerequired - string -
role_arnrequired - string -
state_reasonrequired - string -
state_valuerequired - string
-
-
cloudwatch_metriclist block-
metric_namerequired - string -
metric_namespacerequired - string -
metric_timestampoptional - string -
metric_unitrequired - string -
metric_valuerequired - string -
role_arnrequired - string
-
-
dynamodblist block-
hash_key_fieldrequired - string -
hash_key_typeoptional - string -
hash_key_valuerequired - string -
operationoptional - string -
payload_fieldoptional - string -
range_key_fieldoptional - string -
range_key_typeoptional - string -
range_key_valueoptional - string -
role_arnrequired - string -
table_namerequired - string
-
-
dynamodbv2list block-
role_arnrequired - string -
put_itemlist block-
table_namerequired - string
-
-
-
elasticsearchlist block -
firehoselist block-
delivery_stream_namerequired - string -
role_arnrequired - string -
separatoroptional - string
-
-
iot_analyticslist block-
channel_namerequired - string -
role_arnrequired - string
-
-
iot_eventslist block-
input_namerequired - string -
message_idoptional - string -
role_arnrequired - string
-
-
kinesislist block-
partition_keyoptional - string -
role_arnrequired - string -
stream_namerequired - string
-
-
lambdalist block-
function_arnrequired - string
-
-
republishlist block -
s3list block-
bucket_namerequired - string -
keyrequired - string -
role_arnrequired - string
-
-
snslist block-
message_formatoptional - string -
role_arnrequired - string -
target_arnrequired - string
-
-
sqslist block-
queue_urlrequired - string -
role_arnrequired - string -
use_base64required - bool
-
-
step_functionslist block-
execution_name_prefixoptional - string -
role_arnrequired - string -
state_machine_namerequired - string
-
-
-
firehoseset block-
delivery_stream_namerequired - string -
role_arnrequired - string -
separatoroptional - string
-
-
iot_analyticsset block-
channel_namerequired - string -
role_arnrequired - string
-
-
iot_eventsset block-
input_namerequired - string -
message_idoptional - string -
role_arnrequired - string
-
-
kinesisset block-
partition_keyoptional - string -
role_arnrequired - string -
stream_namerequired - string
-
-
lambdaset block-
function_arnrequired - string
-
-
republishset block -
s3set block-
bucket_namerequired - string -
keyrequired - string -
role_arnrequired - string
-
-
snsset block-
message_formatoptional - string -
role_arnrequired - string -
target_arnrequired - string
-
-
sqsset block-
queue_urlrequired - string -
role_arnrequired - string -
use_base64required - bool
-
-
step_functionsset block-
execution_name_prefixoptional - string -
role_arnrequired - string -
state_machine_namerequired - 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
-
RuleNameoptional - String -
TopicRulePayloadrequired - TopicRulePayload -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
Use the
AWS::IoT::TopicRuleresource 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.