Class CfnTopicRule
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.iot.CfnTopicRule
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.109.0 (build c221850)",
date="2025-03-14T03:24:59.720Z")
@Stability(Stable)
public class CfnTopicRule
extends CfnResource
implements IInspectable, ITaggable
Use the
AWS::IoT::TopicRule
resource 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 .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.iot.*; CfnTopicRule cfnTopicRule = CfnTopicRule.Builder.create(this, "MyCfnTopicRule") .topicRulePayload(TopicRulePayloadProperty.builder() .actions(List.of(ActionProperty.builder() .cloudwatchAlarm(CloudwatchAlarmActionProperty.builder() .alarmName("alarmName") .roleArn("roleArn") .stateReason("stateReason") .stateValue("stateValue") .build()) .cloudwatchLogs(CloudwatchLogsActionProperty.builder() .logGroupName("logGroupName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .build()) .cloudwatchMetric(CloudwatchMetricActionProperty.builder() .metricName("metricName") .metricNamespace("metricNamespace") .metricUnit("metricUnit") .metricValue("metricValue") .roleArn("roleArn") // the properties below are optional .metricTimestamp("metricTimestamp") .build()) .dynamoDb(DynamoDBActionProperty.builder() .hashKeyField("hashKeyField") .hashKeyValue("hashKeyValue") .roleArn("roleArn") .tableName("tableName") // the properties below are optional .hashKeyType("hashKeyType") .payloadField("payloadField") .rangeKeyField("rangeKeyField") .rangeKeyType("rangeKeyType") .rangeKeyValue("rangeKeyValue") .build()) .dynamoDBv2(DynamoDBv2ActionProperty.builder() .putItem(PutItemInputProperty.builder() .tableName("tableName") .build()) .roleArn("roleArn") .build()) .elasticsearch(ElasticsearchActionProperty.builder() .endpoint("endpoint") .id("id") .index("index") .roleArn("roleArn") .type("type") .build()) .firehose(FirehoseActionProperty.builder() .deliveryStreamName("deliveryStreamName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .separator("separator") .build()) .http(HttpActionProperty.builder() .url("url") // the properties below are optional .auth(HttpAuthorizationProperty.builder() .sigv4(SigV4AuthorizationProperty.builder() .roleArn("roleArn") .serviceName("serviceName") .signingRegion("signingRegion") .build()) .build()) .confirmationUrl("confirmationUrl") .headers(List.of(HttpActionHeaderProperty.builder() .key("key") .value("value") .build())) .build()) .iotAnalytics(IotAnalyticsActionProperty.builder() .channelName("channelName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .build()) .iotEvents(IotEventsActionProperty.builder() .inputName("inputName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .messageId("messageId") .build()) .iotSiteWise(IotSiteWiseActionProperty.builder() .putAssetPropertyValueEntries(List.of(PutAssetPropertyValueEntryProperty.builder() .propertyValues(List.of(AssetPropertyValueProperty.builder() .timestamp(AssetPropertyTimestampProperty.builder() .timeInSeconds("timeInSeconds") // the properties below are optional .offsetInNanos("offsetInNanos") .build()) .value(AssetPropertyVariantProperty.builder() .booleanValue("booleanValue") .doubleValue("doubleValue") .integerValue("integerValue") .stringValue("stringValue") .build()) // the properties below are optional .quality("quality") .build())) // the properties below are optional .assetId("assetId") .entryId("entryId") .propertyAlias("propertyAlias") .propertyId("propertyId") .build())) .roleArn("roleArn") .build()) .kafka(KafkaActionProperty.builder() .clientProperties(Map.of( "clientPropertiesKey", "clientProperties")) .destinationArn("destinationArn") .topic("topic") // the properties below are optional .headers(List.of(KafkaActionHeaderProperty.builder() .key("key") .value("value") .build())) .key("key") .partition("partition") .build()) .kinesis(KinesisActionProperty.builder() .roleArn("roleArn") .streamName("streamName") // the properties below are optional .partitionKey("partitionKey") .build()) .lambda(LambdaActionProperty.builder() .functionArn("functionArn") .build()) .location(LocationActionProperty.builder() .deviceId("deviceId") .latitude("latitude") .longitude("longitude") .roleArn("roleArn") .trackerName("trackerName") // the properties below are optional .timestamp(TimestampProperty.builder() .value("value") // the properties below are optional .unit("unit") .build()) .build()) .openSearch(OpenSearchActionProperty.builder() .endpoint("endpoint") .id("id") .index("index") .roleArn("roleArn") .type("type") .build()) .republish(RepublishActionProperty.builder() .roleArn("roleArn") .topic("topic") // the properties below are optional .headers(RepublishActionHeadersProperty.builder() .contentType("contentType") .correlationData("correlationData") .messageExpiry("messageExpiry") .payloadFormatIndicator("payloadFormatIndicator") .responseTopic("responseTopic") .userProperties(List.of(UserPropertyProperty.builder() .key("key") .value("value") .build())) .build()) .qos(123) .build()) .s3(S3ActionProperty.builder() .bucketName("bucketName") .key("key") .roleArn("roleArn") // the properties below are optional .cannedAcl("cannedAcl") .build()) .sns(SnsActionProperty.builder() .roleArn("roleArn") .targetArn("targetArn") // the properties below are optional .messageFormat("messageFormat") .build()) .sqs(SqsActionProperty.builder() .queueUrl("queueUrl") .roleArn("roleArn") // the properties below are optional .useBase64(false) .build()) .stepFunctions(StepFunctionsActionProperty.builder() .roleArn("roleArn") .stateMachineName("stateMachineName") // the properties below are optional .executionNamePrefix("executionNamePrefix") .build()) .timestream(TimestreamActionProperty.builder() .databaseName("databaseName") .dimensions(List.of(TimestreamDimensionProperty.builder() .name("name") .value("value") .build())) .roleArn("roleArn") .tableName("tableName") // the properties below are optional .timestamp(TimestreamTimestampProperty.builder() .unit("unit") .value("value") .build()) .build()) .build())) .sql("sql") // the properties below are optional .awsIotSqlVersion("awsIotSqlVersion") .description("description") .errorAction(ActionProperty.builder() .cloudwatchAlarm(CloudwatchAlarmActionProperty.builder() .alarmName("alarmName") .roleArn("roleArn") .stateReason("stateReason") .stateValue("stateValue") .build()) .cloudwatchLogs(CloudwatchLogsActionProperty.builder() .logGroupName("logGroupName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .build()) .cloudwatchMetric(CloudwatchMetricActionProperty.builder() .metricName("metricName") .metricNamespace("metricNamespace") .metricUnit("metricUnit") .metricValue("metricValue") .roleArn("roleArn") // the properties below are optional .metricTimestamp("metricTimestamp") .build()) .dynamoDb(DynamoDBActionProperty.builder() .hashKeyField("hashKeyField") .hashKeyValue("hashKeyValue") .roleArn("roleArn") .tableName("tableName") // the properties below are optional .hashKeyType("hashKeyType") .payloadField("payloadField") .rangeKeyField("rangeKeyField") .rangeKeyType("rangeKeyType") .rangeKeyValue("rangeKeyValue") .build()) .dynamoDBv2(DynamoDBv2ActionProperty.builder() .putItem(PutItemInputProperty.builder() .tableName("tableName") .build()) .roleArn("roleArn") .build()) .elasticsearch(ElasticsearchActionProperty.builder() .endpoint("endpoint") .id("id") .index("index") .roleArn("roleArn") .type("type") .build()) .firehose(FirehoseActionProperty.builder() .deliveryStreamName("deliveryStreamName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .separator("separator") .build()) .http(HttpActionProperty.builder() .url("url") // the properties below are optional .auth(HttpAuthorizationProperty.builder() .sigv4(SigV4AuthorizationProperty.builder() .roleArn("roleArn") .serviceName("serviceName") .signingRegion("signingRegion") .build()) .build()) .confirmationUrl("confirmationUrl") .headers(List.of(HttpActionHeaderProperty.builder() .key("key") .value("value") .build())) .build()) .iotAnalytics(IotAnalyticsActionProperty.builder() .channelName("channelName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .build()) .iotEvents(IotEventsActionProperty.builder() .inputName("inputName") .roleArn("roleArn") // the properties below are optional .batchMode(false) .messageId("messageId") .build()) .iotSiteWise(IotSiteWiseActionProperty.builder() .putAssetPropertyValueEntries(List.of(PutAssetPropertyValueEntryProperty.builder() .propertyValues(List.of(AssetPropertyValueProperty.builder() .timestamp(AssetPropertyTimestampProperty.builder() .timeInSeconds("timeInSeconds") // the properties below are optional .offsetInNanos("offsetInNanos") .build()) .value(AssetPropertyVariantProperty.builder() .booleanValue("booleanValue") .doubleValue("doubleValue") .integerValue("integerValue") .stringValue("stringValue") .build()) // the properties below are optional .quality("quality") .build())) // the properties below are optional .assetId("assetId") .entryId("entryId") .propertyAlias("propertyAlias") .propertyId("propertyId") .build())) .roleArn("roleArn") .build()) .kafka(KafkaActionProperty.builder() .clientProperties(Map.of( "clientPropertiesKey", "clientProperties")) .destinationArn("destinationArn") .topic("topic") // the properties below are optional .headers(List.of(KafkaActionHeaderProperty.builder() .key("key") .value("value") .build())) .key("key") .partition("partition") .build()) .kinesis(KinesisActionProperty.builder() .roleArn("roleArn") .streamName("streamName") // the properties below are optional .partitionKey("partitionKey") .build()) .lambda(LambdaActionProperty.builder() .functionArn("functionArn") .build()) .location(LocationActionProperty.builder() .deviceId("deviceId") .latitude("latitude") .longitude("longitude") .roleArn("roleArn") .trackerName("trackerName") // the properties below are optional .timestamp(TimestampProperty.builder() .value("value") // the properties below are optional .unit("unit") .build()) .build()) .openSearch(OpenSearchActionProperty.builder() .endpoint("endpoint") .id("id") .index("index") .roleArn("roleArn") .type("type") .build()) .republish(RepublishActionProperty.builder() .roleArn("roleArn") .topic("topic") // the properties below are optional .headers(RepublishActionHeadersProperty.builder() .contentType("contentType") .correlationData("correlationData") .messageExpiry("messageExpiry") .payloadFormatIndicator("payloadFormatIndicator") .responseTopic("responseTopic") .userProperties(List.of(UserPropertyProperty.builder() .key("key") .value("value") .build())) .build()) .qos(123) .build()) .s3(S3ActionProperty.builder() .bucketName("bucketName") .key("key") .roleArn("roleArn") // the properties below are optional .cannedAcl("cannedAcl") .build()) .sns(SnsActionProperty.builder() .roleArn("roleArn") .targetArn("targetArn") // the properties below are optional .messageFormat("messageFormat") .build()) .sqs(SqsActionProperty.builder() .queueUrl("queueUrl") .roleArn("roleArn") // the properties below are optional .useBase64(false) .build()) .stepFunctions(StepFunctionsActionProperty.builder() .roleArn("roleArn") .stateMachineName("stateMachineName") // the properties below are optional .executionNamePrefix("executionNamePrefix") .build()) .timestream(TimestreamActionProperty.builder() .databaseName("databaseName") .dimensions(List.of(TimestreamDimensionProperty.builder() .name("name") .value("value") .build())) .roleArn("roleArn") .tableName("tableName") // the properties below are optional .timestamp(TimestreamTimestampProperty.builder() .unit("unit") .value("value") .build()) .build()) .build()) .ruleDisabled(false) .build()) // the properties below are optional .ruleName("ruleName") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Describes the actions associated with a rule.static interface
An asset property timestamp entry containing the following information.static interface
An asset property value entry containing the following information.static interface
Contains an asset property value (of a single type).static final class
A fluent builder forCfnTopicRule
.static interface
Describes an action that updates a CloudWatch alarm.static interface
Describes an action that updates a CloudWatch log.static interface
Describes an action that captures a CloudWatch metric.static interface
Describes an action to write to a DynamoDB table.static interface
Describes an action to write to a DynamoDB table.static interface
Describes an action that writes data to an Amazon OpenSearch Service domain.static interface
Describes an action that writes data to an Amazon Kinesis Firehose stream.static interface
The HTTP action header.static interface
Send data to an HTTPS endpoint.static interface
The authorization method used to send messages.static interface
Sends message data to an AWS IoT Analytics channel.static interface
Sends an input to an AWS IoT Events detector.static interface
Describes an action to send data from an MQTT message that triggered the rule to AWS IoT SiteWise asset properties.static interface
Specifies a Kafka header using key-value pairs when you create a Rule’s Kafka Action.static interface
Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.static interface
Describes an action to write data to an Amazon Kinesis stream.static interface
Describes an action to invoke a Lambda function.static interface
Describes an action to send device location updates from an MQTT message to an Amazon Location tracker resource.static interface
Describes an action that writes data to an Amazon OpenSearch Service domain.static interface
An asset property value entry containing the following information.static interface
The input for the DynamoActionVS action that specifies the DynamoDB table to which the message data will be written.static interface
Specifies MQTT Version 5.0 headers information.static interface
Describes an action to republish to another topic.static interface
Describes an action to write data to an Amazon S3 bucket.static interface
For more information, see Signature Version 4 signing process .static interface
Describes an action to publish to an Amazon SNS topic.static interface
Describes an action to publish data to an Amazon SQS queue.static interface
Starts execution of a Step Functions state machine.static interface
Describes how to interpret an application-defined timestamp value from an MQTT message payload and the precision of that value.static interface
Describes an action that writes records into an Amazon Timestream table.static interface
Metadata attributes of the time series that are written in each measure record.static interface
The value to use for the entry's timestamp.static interface
Describes a rule.static interface
A key-value pair that you define in the header.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CfnTopicRule
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnTopicRule
(software.amazon.jsii.JsiiObjectRef objRef) CfnTopicRule
(software.constructs.Construct scope, String id, CfnTopicRuleProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of the AWS IoT rule, such asarn:aws:iot:us-east-2:123456789012:rule/MyIoTRule
.The name of the rule.getTags()
Tag Manager which manages the tags for this resource.Metadata which can be used to manage the topic rule.The rule payload.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setRuleName
(String value) The name of the rule.void
setTagsRaw
(List<CfnTag> value) Metadata which can be used to manage the topic rule.void
setTopicRulePayload
(IResolvable value) The rule payload.void
The rule payload.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnTopicRule
protected CfnTopicRule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnTopicRule
protected CfnTopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnTopicRule
@Stability(Stable) public CfnTopicRule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnTopicRuleProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) of the AWS IoT rule, such asarn:aws:iot:us-east-2:123456789012:rule/MyIoTRule
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getTopicRulePayload
The rule payload. -
setTopicRulePayload
The rule payload. -
setTopicRulePayload
@Stability(Stable) public void setTopicRulePayload(@NotNull CfnTopicRule.TopicRulePayloadProperty value) The rule payload. -
getRuleName
The name of the rule. -
setRuleName
The name of the rule. -
getTagsRaw
Metadata which can be used to manage the topic rule. -
setTagsRaw
Metadata which can be used to manage the topic rule.
-