Class CfnTopicRule
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.CfnElement
software.amazon.awscdk.core.CfnRefElement
software.amazon.awscdk.core.CfnResource
software.amazon.awscdk.services.iot.CfnTopicRule
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:29:57.649Z")
@Stability(Stable)
public class CfnTopicRule
extends CfnResource
implements IInspectable
A CloudFormation
AWS::IoT::TopicRule.
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
.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(new Date())
.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
.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(new Date())
.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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes the actions associated with a rule.static interfaceAn asset property timestamp entry containing the following information.static interfaceAn asset property value entry containing the following information.static interfaceContains an asset property value (of a single type).static final classA fluent builder forCfnTopicRule.static interfaceDescribes an action that updates a CloudWatch alarm.static interfaceDescribes an action that updates a CloudWatch log.static interfaceDescribes an action that captures a CloudWatch metric.static interfaceDescribes an action to write to a DynamoDB table.static interfaceDescribes an action to write to a DynamoDB table.static interfaceDescribes an action that writes data to an Amazon OpenSearch Service domain.static interfaceDescribes an action that writes data to an Amazon Kinesis Firehose stream.static interfaceThe HTTP action header.static interfaceSend data to an HTTPS endpoint.static interfaceThe authorization method used to send messages.static interfaceSends message data to an AWS IoT Analytics channel.static interfaceSends an input to an AWS IoT Events detector.static interfaceDescribes an action to send data from an MQTT message that triggered the rule to AWS IoT SiteWise asset properties.static interfaceSend messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.static interfaceDescribes an action to write data to an Amazon Kinesis stream.static interfaceDescribes an action to invoke a Lambda function.static interfaceDescribes an action to send device location updates from an MQTT message to an Amazon Location tracker resource.static interfaceDescribes an action that writes data to an Amazon OpenSearch Service domain.static interfaceAn asset property value entry containing the following information.static interfaceThe input for the DynamoActionVS action that specifies the DynamoDB table to which the message data will be written.static interfaceSpecifies MQTT Version 5.0 headers information.static interfaceDescribes an action to republish to another topic.static interfaceDescribes an action to write data to an Amazon S3 bucket.static interfaceFor more information, see Signature Version 4 signing process .static interfaceDescribes an action to publish to an Amazon SNS topic.static interfaceDescribes an action to publish data to an Amazon SQS queue.static interfaceStarts execution of a Step Functions state machine.static interfaceDescribes how to interpret an application-defined timestamp value from an MQTT message payload and the precision of that value.static interfaceDescribes an action that writes records into an Amazon Timestream table.static interfaceMetadata attributes of the time series that are written in each measure record.static interfaceThe value to use for the entry's timestamp.static interfaceDescribes a rule.static interfaceA key-value pair that you define in the header.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnTopicRule(Construct scope, String id, CfnTopicRuleProps props) Create a newAWS::IoT::TopicRule.protectedCfnTopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnTopicRule(software.amazon.jsii.JsiiObjectRef objRef) -
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()Metadata which can be used to manage the topic rule.The rule payload.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetRuleName(String value) The name of the rule.voidsetTopicRulePayload(IResolvable value) The rule payload.voidThe rule payload.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 Construct scope, @NotNull String id, @NotNull CfnTopicRuleProps props) Create a newAWS::IoT::TopicRule.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin 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:
getCfnPropertiesin classCfnResource
-
getTags
Metadata which can be used to manage the topic rule.For URI Request parameters use format: ...key1=value1&key2=value2...
For the CLI command-line parameter use format: --tags "key1=value1&key2=value2..."
For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
-
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.
-