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 |
The registration configuration.
|
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`.
|
CfnJobTemplate.AbortConfigProperty |
The criteria that determine when and how a job abort takes place.
|
CfnJobTemplate.AbortCriteriaProperty |
The criteria that determine when and how a job abort takes place.
|
CfnJobTemplate.ExponentialRolloutRateProperty |
Allows you to create an exponential rate of rollout for a job.
|
CfnJobTemplate.JobExecutionsRetryConfigProperty |
The configuration that determines how many retries are allowed for each failure type for a job.
|
CfnJobTemplate.JobExecutionsRolloutConfigProperty |
Allows you to create a staged rollout of a job.
|
CfnJobTemplate.PresignedUrlConfigProperty |
Configuration for pre-signed S3 URLs.
|
CfnJobTemplate.RateIncreaseCriteriaProperty |
Allows you to define a criteria to initiate the increase in rate of rollout for a job.
|
CfnJobTemplate.RetryCriteriaProperty |
The criteria that determines how many retries are allowed for each failure type for a job.
|
CfnJobTemplate.TimeoutConfigProperty |
Specifies the amount of time each device has to finish its execution of the job.
|
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.LocationActionProperty |
Describes an action to send device location updates from an MQTT message to an Amazon Location tracker resource.
|
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.RepublishActionHeadersProperty |
Specifies MQTT Version 5.0 headers information.
|
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.TimestampProperty |
Describes how to interpret an application-defined timestamp value from an MQTT message payload and the precision of that value.
|
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.
|
CfnTopicRule.UserPropertyProperty |
A key-value pair that you define in the header.
|
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.
|
---
All classes with the
Cfn
prefix in this module (CFN Resources) are always stable and safe to use.
The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
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.services.iot.*; import software.amazon.awscdk.services.iot.actions.*;
TopicRule
Create 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.services.logs.*; 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.