| Interface | Description |
|---|---|
| ActionConfig |
(experimental) Properties for an topic rule action.
|
| CfnAccountAuditConfiguration.AuditCheckConfigurationProperty |
Which audit checks are enabled and disabled for this account.
|
| CfnAccountAuditConfiguration.AuditCheckConfigurationsProperty |
The types of audit checks that can be performed.
|
| CfnAccountAuditConfiguration.AuditNotificationTargetConfigurationsProperty |
The configuration of the audit notification target.
|
| CfnAccountAuditConfiguration.AuditNotificationTargetProperty |
Information about the targets to which audit notifications are sent.
|
| CfnAccountAuditConfigurationProps |
Properties for defining a `CfnAccountAuditConfiguration`.
|
| CfnAuthorizerProps |
Properties for defining a `CfnAuthorizer`.
|
| CfnCACertificate.RegistrationConfigProperty |
Example:
|
| CfnCACertificateProps |
Properties for defining a `CfnCACertificate`.
|
| CfnCertificateProps |
Properties for defining a `CfnCertificate`.
|
| CfnCustomMetricProps |
Properties for defining a `CfnCustomMetric`.
|
| CfnDimensionProps |
Properties for defining a `CfnDimension`.
|
| CfnDomainConfiguration.AuthorizerConfigProperty |
An object that specifies the authorization service for a domain.
|
| CfnDomainConfiguration.ServerCertificateSummaryProperty |
An object that contains information about a server certificate.
|
| CfnDomainConfigurationProps |
Properties for defining a `CfnDomainConfiguration`.
|
| CfnFleetMetric.AggregationTypeProperty |
The type of aggregation queries.
|
| CfnFleetMetricProps |
Properties for defining a `CfnFleetMetric`.
|
| CfnJobTemplateProps |
Properties for defining a `CfnJobTemplate`.
|
| CfnLoggingProps |
Properties for defining a `CfnLogging`.
|
| CfnMitigationAction.ActionParamsProperty |
Defines the type of action and the parameters for that action.
|
| CfnMitigationAction.AddThingsToThingGroupParamsProperty |
Parameters used when defining a mitigation action that move a set of things to a thing group.
|
| CfnMitigationAction.EnableIoTLoggingParamsProperty |
Parameters used when defining a mitigation action that enable AWS IoT Core logging.
|
| CfnMitigationAction.PublishFindingToSnsParamsProperty |
Parameters to define a mitigation action that publishes findings to Amazon SNS.
|
| CfnMitigationAction.ReplaceDefaultPolicyVersionParamsProperty |
Parameters to define a mitigation action that adds a blank policy to restrict permissions.
|
| CfnMitigationAction.UpdateCACertificateParamsProperty |
Parameters to define a mitigation action that changes the state of the CA certificate to inactive.
|
| CfnMitigationAction.UpdateDeviceCertificateParamsProperty |
Parameters to define a mitigation action that changes the state of the device certificate to inactive.
|
| CfnMitigationActionProps |
Properties for defining a `CfnMitigationAction`.
|
| CfnPolicyPrincipalAttachmentProps |
Properties for defining a `CfnPolicyPrincipalAttachment`.
|
| CfnPolicyProps |
Properties for defining a `CfnPolicy`.
|
| CfnProvisioningTemplate.ProvisioningHookProperty |
Structure that contains payloadVersion and targetArn.
|
| CfnProvisioningTemplateProps |
Properties for defining a `CfnProvisioningTemplate`.
|
| CfnResourceSpecificLoggingProps |
Properties for defining a `CfnResourceSpecificLogging`.
|
| CfnRoleAliasProps |
Properties for defining a `CfnRoleAlias`.
|
| CfnScheduledAuditProps |
Properties for defining a `CfnScheduledAudit`.
|
| CfnSecurityProfile.AlertTargetProperty |
A structure containing the alert target ARN and the role ARN.
|
| CfnSecurityProfile.BehaviorCriteriaProperty |
The criteria by which the behavior is determined to be normal.
|
| CfnSecurityProfile.BehaviorProperty |
A Device Defender security profile behavior.
|
| CfnSecurityProfile.MachineLearningDetectionConfigProperty |
The `MachineLearningDetectionConfig` property type controls confidence of the machine learning model.
|
| CfnSecurityProfile.MetricDimensionProperty |
The dimension of the metric.
|
| CfnSecurityProfile.MetricToRetainProperty |
The metric you want to retain.
|
| CfnSecurityProfile.MetricValueProperty |
The value to be compared with the `metric` .
|
| CfnSecurityProfile.StatisticalThresholdProperty |
A statistical ranking (percentile) that indicates a threshold value by which a behavior is determined to be in compliance or in violation of the behavior.
|
| CfnSecurityProfileProps |
Properties for defining a `CfnSecurityProfile`.
|
| CfnThing.AttributePayloadProperty |
The AttributePayload property specifies up to three attributes for an AWS IoT as key-value pairs.
|
| CfnThingPrincipalAttachmentProps |
Properties for defining a `CfnThingPrincipalAttachment`.
|
| CfnThingProps |
Properties for defining a `CfnThing`.
|
| CfnTopicRule.ActionProperty |
Describes the actions associated with a rule.
|
| CfnTopicRule.AssetPropertyTimestampProperty |
An asset property timestamp entry containing the following information.
|
| CfnTopicRule.AssetPropertyValueProperty |
An asset property value entry containing the following information.
|
| CfnTopicRule.AssetPropertyVariantProperty |
Contains an asset property value (of a single type).
|
| CfnTopicRule.CloudwatchAlarmActionProperty |
Describes an action that updates a CloudWatch alarm.
|
| CfnTopicRule.CloudwatchLogsActionProperty |
Describes an action that updates a CloudWatch log.
|
| CfnTopicRule.CloudwatchMetricActionProperty |
Describes an action that captures a CloudWatch metric.
|
| CfnTopicRule.DynamoDBActionProperty |
Describes an action to write to a DynamoDB table.
|
| CfnTopicRule.DynamoDBv2ActionProperty |
Describes an action to write to a DynamoDB table.
|
| CfnTopicRule.ElasticsearchActionProperty |
Describes an action that writes data to an Amazon OpenSearch Service domain.
|
| CfnTopicRule.FirehoseActionProperty |
Describes an action that writes data to an Amazon Kinesis Firehose stream.
|
| CfnTopicRule.HttpActionHeaderProperty |
The HTTP action header.
|
| CfnTopicRule.HttpActionProperty |
Send data to an HTTPS endpoint.
|
| CfnTopicRule.HttpAuthorizationProperty |
The authorization method used to send messages.
|
| CfnTopicRule.IotAnalyticsActionProperty |
Sends message data to an AWS IoT Analytics channel.
|
| CfnTopicRule.IotEventsActionProperty |
Sends an input to an AWS IoT Events detector.
|
| CfnTopicRule.IotSiteWiseActionProperty |
Describes an action to send data from an MQTT message that triggered the rule to AWS IoT SiteWise asset properties.
|
| CfnTopicRule.KafkaActionProperty |
Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.
|
| CfnTopicRule.KinesisActionProperty |
Describes an action to write data to an Amazon Kinesis stream.
|
| CfnTopicRule.LambdaActionProperty |
Describes an action to invoke a Lambda function.
|
| CfnTopicRule.OpenSearchActionProperty |
Describes an action that writes data to an Amazon OpenSearch Service domain.
|
| CfnTopicRule.PutAssetPropertyValueEntryProperty |
An asset property value entry containing the following information.
|
| CfnTopicRule.PutItemInputProperty |
The input for the DynamoActionVS action that specifies the DynamoDB table to which the message data will be written.
|
| CfnTopicRule.RepublishActionProperty |
Describes an action to republish to another topic.
|
| CfnTopicRule.S3ActionProperty |
Describes an action to write data to an Amazon S3 bucket.
|
| CfnTopicRule.SigV4AuthorizationProperty |
For more information, see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) .
|
| CfnTopicRule.SnsActionProperty |
Describes an action to publish to an Amazon SNS topic.
|
| CfnTopicRule.SqsActionProperty |
Describes an action to publish data to an Amazon SQS queue.
|
| CfnTopicRule.StepFunctionsActionProperty |
Starts execution of a Step Functions state machine.
|
| CfnTopicRule.TimestreamActionProperty |
Describes an action that writes records into an Amazon Timestream table.
|
| CfnTopicRule.TimestreamDimensionProperty |
Metadata attributes of the time series that are written in each measure record.
|
| CfnTopicRule.TimestreamTimestampProperty |
The value to use for the entry's timestamp.
|
| CfnTopicRule.TopicRulePayloadProperty |
Describes a rule.
|
| CfnTopicRuleDestination.HttpUrlDestinationSummaryProperty |
HTTP URL destination properties.
|
| CfnTopicRuleDestination.VpcDestinationPropertiesProperty |
The properties of a virtual private cloud (VPC) destination.
|
| CfnTopicRuleDestinationProps |
Properties for defining a `CfnTopicRuleDestination`.
|
| CfnTopicRuleProps |
Properties for defining a `CfnTopicRule`.
|
| IAction |
(experimental) An abstract action for TopicRule.
|
| IAction.Jsii$Default |
Internal default implementation for
IAction. |
| IotSqlConfig |
(experimental) The type returned from the `bind()` method in
IotSql. |
| ITopicRule |
(experimental) Represents an AWS IoT Rule.
|
| ITopicRule.Jsii$Default |
Internal default implementation for
ITopicRule. |
| TopicRuleProps |
(experimental) Properties for defining an AWS IoT Rule.
|
AWS IoT Core lets you connect billions of IoT devices and route trillions of messages to AWS services without managing infrastructure.
Install the module:
$ npm i @aws-cdk/aws-iot
Import it into your code:
import software.amazon.awscdk.core.*; import software.amazon.awscdk.core.*;
TopicRuleCreate a topic rule that give your devices the ability to interact with AWS services. You can create a topic rule with an action that invoke the Lambda action as following:
Function func = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.NODEJS_14_X)
.handler("index.handler")
.code(Code.fromInline("\n exports.handler = (event) => {\n console.log(\"It is test for lambda action of AWS IoT Rule.\", event);\n };"))
.build();
TopicRule.Builder.create(this, "TopicRule")
.topicRuleName("MyTopicRule") // optional
.description("invokes the lambda function") // optional
.sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"))
.actions(List.of(new LambdaFunctionAction(func)))
.build();
Or, you can add an action after constructing the TopicRule instance as following:
Function func;
TopicRule topicRule = TopicRule.Builder.create(this, "TopicRule")
.sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"))
.build();
topicRule.addAction(new LambdaFunctionAction(func));
You can also supply errorAction as following,
and the IoT Rule will trigger it if a rule's action is unable to perform:
import software.amazon.awscdk.core.*;
LogGroup logGroup = new LogGroup(this, "MyLogGroup");
TopicRule.Builder.create(this, "TopicRule")
.sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"))
.errorAction(new CloudWatchLogsAction(logGroup))
.build();
If you wanna make the topic rule disable, add property enabled: false as following:
TopicRule.Builder.create(this, "TopicRule")
.sql(IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"))
.enabled(false)
.build();
See also @aws-cdk/aws-iot-actions for other actions.
Copyright © 2022. All rights reserved.