Skip to main content

topic_rules

Creates, updates, deletes or gets a topic_rule resource or lists topic_rules in a region

Overview

Nametopic_rules
TypeResource
DescriptionResource Type definition for AWS::IoT::TopicRule
Idaws.iot.topic_rules

Fields

NameDatatypeDescription
arnstring
rule_namestring
topic_rule_payloadobject
tagsarray
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTTopicRulePayload, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all topic_rules in a region.

SELECT
region,
arn,
rule_name,
topic_rule_payload,
tags
FROM aws.iot.topic_rules
WHERE region = 'us-east-1';

Gets all properties from an individual topic_rule.

SELECT
region,
arn,
rule_name,
topic_rule_payload,
tags
FROM aws.iot.topic_rules
WHERE region = 'us-east-1' AND data__Identifier = '<RuleName>';

INSERT example

Use the following StackQL query and manifest file to create a new topic_rule resource, using stack-deploy.

/*+ create */
INSERT INTO aws.iot.topic_rules (
TopicRulePayload,
region
)
SELECT
'{{ TopicRulePayload }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.iot.topic_rules
WHERE data__Identifier = '<RuleName>'
AND region = 'us-east-1';

Permissions

To operate on the topic_rules resource, the following permissions are required:

Create

iam:PassRole,
iot:CreateTopicRule,
iot:GetTopicRule,
iot:TagResource,
iot:ListTagsForResource

Read

iot:GetTopicRule,
iot:ListTagsForResource

Update

iam:PassRole,
iot:GetTopicRule,
iot:ListTagsForResource,
iot:ReplaceTopicRule,
iot:TagResource,
iot:UntagResource

Delete

iot:GetTopicRule,
iot:DeleteTopicRule

List

iot:ListTopicRules