topic_rules
Creates, updates, deletes or gets a topic_rule
resource or lists topic_rules
in a region
Overview
Name | topic_rules |
Type | Resource |
Description | Resource Type definition for AWS::IoT::TopicRule |
Id | aws.iot.topic_rules |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | |
rule_name | string | |
topic_rule_payload | object | |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | TopicRulePayload, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.topic_rules (
TopicRulePayload,
region
)
SELECT
'{{ TopicRulePayload }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.topic_rules (
RuleName,
TopicRulePayload,
Tags,
region
)
SELECT
'{{ RuleName }}',
'{{ TopicRulePayload }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: topic_rule
props:
- name: RuleName
value: '{{ RuleName }}'
- name: TopicRulePayload
value:
RuleDisabled: '{{ RuleDisabled }}'
ErrorAction:
CloudwatchAlarm:
StateValue: '{{ StateValue }}'
AlarmName: '{{ AlarmName }}'
StateReason: '{{ StateReason }}'
RoleArn: '{{ RoleArn }}'
CloudwatchLogs:
LogGroupName: '{{ LogGroupName }}'
RoleArn: '{{ RoleArn }}'
BatchMode: '{{ BatchMode }}'
CloudwatchMetric:
MetricName: '{{ MetricName }}'
MetricValue: '{{ MetricValue }}'
MetricNamespace: '{{ MetricNamespace }}'
MetricUnit: '{{ MetricUnit }}'
RoleArn: '{{ RoleArn }}'
MetricTimestamp: '{{ MetricTimestamp }}'
DynamoDB:
TableName: '{{ TableName }}'
PayloadField: '{{ PayloadField }}'
RangeKeyField: '{{ RangeKeyField }}'
HashKeyField: '{{ HashKeyField }}'
RangeKeyValue: '{{ RangeKeyValue }}'
RangeKeyType: '{{ RangeKeyType }}'
HashKeyType: '{{ HashKeyType }}'
HashKeyValue: '{{ HashKeyValue }}'
RoleArn: '{{ RoleArn }}'
DynamoDBv2:
PutItem:
TableName: '{{ TableName }}'
RoleArn: '{{ RoleArn }}'
Elasticsearch:
Type: '{{ Type }}'
Index: '{{ Index }}'
Id: '{{ Id }}'
Endpoint: '{{ Endpoint }}'
RoleArn: '{{ RoleArn }}'
Firehose:
DeliveryStreamName: '{{ DeliveryStreamName }}'
RoleArn: '{{ RoleArn }}'
Separator: '{{ Separator }}'
BatchMode: '{{ BatchMode }}'
Http:
ConfirmationUrl: '{{ ConfirmationUrl }}'
Headers:
- Value: '{{ Value }}'
Key: '{{ Key }}'
Url: '{{ Url }}'
Auth:
Sigv4:
ServiceName: '{{ ServiceName }}'
SigningRegion: '{{ SigningRegion }}'
RoleArn: '{{ RoleArn }}'
IotAnalytics:
RoleArn: '{{ RoleArn }}'
ChannelName: '{{ ChannelName }}'
BatchMode: '{{ BatchMode }}'
IotEvents:
InputName: '{{ InputName }}'
RoleArn: '{{ RoleArn }}'
MessageId: '{{ MessageId }}'
BatchMode: '{{ BatchMode }}'
IotSiteWise:
RoleArn: '{{ RoleArn }}'
PutAssetPropertyValueEntries:
- PropertyAlias: '{{ PropertyAlias }}'
PropertyValues:
- Value:
StringValue: '{{ StringValue }}'
DoubleValue: '{{ DoubleValue }}'
BooleanValue: '{{ BooleanValue }}'
IntegerValue: '{{ IntegerValue }}'
Timestamp:
TimeInSeconds: '{{ TimeInSeconds }}'
OffsetInNanos: '{{ OffsetInNanos }}'
Quality: '{{ Quality }}'
AssetId: '{{ AssetId }}'
EntryId: '{{ EntryId }}'
PropertyId: '{{ PropertyId }}'
Kafka:
DestinationArn: '{{ DestinationArn }}'
Topic: '{{ Topic }}'
Key: '{{ Key }}'
Partition: '{{ Partition }}'
ClientProperties: {}
Headers:
- Value: '{{ Value }}'
Key: '{{ Key }}'
Kinesis:
PartitionKey: '{{ PartitionKey }}'
StreamName: '{{ StreamName }}'
RoleArn: '{{ RoleArn }}'
Lambda:
FunctionArn: '{{ FunctionArn }}'
Location:
RoleArn: '{{ RoleArn }}'
TrackerName: '{{ TrackerName }}'
DeviceId: '{{ DeviceId }}'
Latitude: '{{ Latitude }}'
Longitude: '{{ Longitude }}'
Timestamp:
Value: '{{ Value }}'
Unit: '{{ Unit }}'
OpenSearch:
Type: '{{ Type }}'
Index: '{{ Index }}'
Id: '{{ Id }}'
Endpoint: '{{ Endpoint }}'
RoleArn: '{{ RoleArn }}'
Republish:
Qos: '{{ Qos }}'
Topic: '{{ Topic }}'
RoleArn: '{{ RoleArn }}'
Headers:
PayloadFormatIndicator: '{{ PayloadFormatIndicator }}'
ContentType: '{{ ContentType }}'
ResponseTopic: '{{ ResponseTopic }}'
CorrelationData: '{{ CorrelationData }}'
MessageExpiry: '{{ MessageExpiry }}'
UserProperties:
- Key: '{{ Key }}'
Value: '{{ Value }}'
S3:
BucketName: '{{ BucketName }}'
Key: '{{ Key }}'
RoleArn: '{{ RoleArn }}'
CannedAcl: '{{ CannedAcl }}'
Sns:
TargetArn: '{{ TargetArn }}'
MessageFormat: '{{ MessageFormat }}'
RoleArn: '{{ RoleArn }}'
Sqs:
RoleArn: '{{ RoleArn }}'
UseBase64: '{{ UseBase64 }}'
QueueUrl: '{{ QueueUrl }}'
StepFunctions:
ExecutionNamePrefix: '{{ ExecutionNamePrefix }}'
StateMachineName: '{{ StateMachineName }}'
RoleArn: '{{ RoleArn }}'
Timestream:
RoleArn: '{{ RoleArn }}'
DatabaseName: '{{ DatabaseName }}'
TableName: '{{ TableName }}'
Dimensions:
- Name: '{{ Name }}'
Value: '{{ Value }}'
Timestamp:
Value: '{{ Value }}'
Unit: '{{ Unit }}'
Description: '{{ Description }}'
AwsIotSqlVersion: '{{ AwsIotSqlVersion }}'
Actions:
- null
Sql: '{{ Sql }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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