@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.900Z") @Stability(value=Stable) public class CfnTopicRule extends CfnResource implements IInspectable
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")
.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())
.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
.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
.batchMode(false)
.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")
.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())
.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
.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
.batchMode(false)
.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();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnTopicRule.ActionProperty
Describes the actions associated with a rule.
|
static interface |
CfnTopicRule.AssetPropertyTimestampProperty
An asset property timestamp entry containing the following information.
|
static interface |
CfnTopicRule.AssetPropertyValueProperty
An asset property value entry containing the following information.
|
static interface |
CfnTopicRule.AssetPropertyVariantProperty
Contains an asset property value (of a single type).
|
static class |
CfnTopicRule.Builder
A fluent builder for
CfnTopicRule. |
static interface |
CfnTopicRule.CloudwatchAlarmActionProperty
Describes an action that updates a CloudWatch alarm.
|
static interface |
CfnTopicRule.CloudwatchLogsActionProperty
Describes an action that updates a CloudWatch log.
|
static interface |
CfnTopicRule.CloudwatchMetricActionProperty
Describes an action that captures a CloudWatch metric.
|
static interface |
CfnTopicRule.DynamoDBActionProperty
Describes an action to write to a DynamoDB table.
|
static interface |
CfnTopicRule.DynamoDBv2ActionProperty
Describes an action to write to a DynamoDB table.
|
static interface |
CfnTopicRule.ElasticsearchActionProperty
Describes an action that writes data to an Amazon OpenSearch Service domain.
|
static interface |
CfnTopicRule.FirehoseActionProperty
Describes an action that writes data to an Amazon Kinesis Firehose stream.
|
static interface |
CfnTopicRule.HttpActionHeaderProperty
The HTTP action header.
|
static interface |
CfnTopicRule.HttpActionProperty
Send data to an HTTPS endpoint.
|
static interface |
CfnTopicRule.HttpAuthorizationProperty
The authorization method used to send messages.
|
static interface |
CfnTopicRule.IotAnalyticsActionProperty
Sends message data to an AWS IoT Analytics channel.
|
static interface |
CfnTopicRule.IotEventsActionProperty
Sends an input to an AWS IoT Events detector.
|
static interface |
CfnTopicRule.IotSiteWiseActionProperty
Describes an action to send data from an MQTT message that triggered the rule to AWS IoT SiteWise asset properties.
|
static interface |
CfnTopicRule.KafkaActionProperty
Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.
|
static interface |
CfnTopicRule.KinesisActionProperty
Describes an action to write data to an Amazon Kinesis stream.
|
static interface |
CfnTopicRule.LambdaActionProperty
Describes an action to invoke a Lambda function.
|
static interface |
CfnTopicRule.OpenSearchActionProperty
Describes an action that writes data to an Amazon OpenSearch Service domain.
|
static interface |
CfnTopicRule.PutAssetPropertyValueEntryProperty
An asset property value entry containing the following information.
|
static interface |
CfnTopicRule.PutItemInputProperty
The input for the DynamoActionVS action that specifies the DynamoDB table to which the message data will be written.
|
static interface |
CfnTopicRule.RepublishActionProperty
Describes an action to republish to another topic.
|
static interface |
CfnTopicRule.S3ActionProperty
Describes an action to write data to an Amazon S3 bucket.
|
static interface |
CfnTopicRule.SigV4AuthorizationProperty
For more information, see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) .
|
static interface |
CfnTopicRule.SnsActionProperty
Describes an action to publish to an Amazon SNS topic.
|
static interface |
CfnTopicRule.SqsActionProperty
Describes an action to publish data to an Amazon SQS queue.
|
static interface |
CfnTopicRule.StepFunctionsActionProperty
Starts execution of a Step Functions state machine.
|
static interface |
CfnTopicRule.TimestreamActionProperty
Describes an action that writes records into an Amazon Timestream table.
|
static interface |
CfnTopicRule.TimestreamDimensionProperty
Metadata attributes of the time series that are written in each measure record.
|
static interface |
CfnTopicRule.TimestreamTimestampProperty
The value to use for the entry's timestamp.
|
static interface |
CfnTopicRule.TopicRulePayloadProperty
Describes a rule.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnTopicRule(software.constructs.Construct scope,
String id,
CfnTopicRuleProps props)
Create a new `AWS::IoT::TopicRule`.
|
protected |
CfnTopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnTopicRule(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
The Amazon Resource Name (ARN) of the AWS IoT rule, such as `arn:aws:iot:us-east-2:123456789012:rule/MyIoTRule` .
|
protected Map<String,Object> |
getCfnProperties() |
String |
getRuleName()
The name of the rule.
|
TagManager |
getTags()
Metadata which can be used to manage the topic rule.
|
Object |
getTopicRulePayload()
The rule payload.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setRuleName(String value)
The name of the rule.
|
void |
setTopicRulePayload(CfnTopicRule.TopicRulePayloadProperty value)
The rule payload.
|
void |
setTopicRulePayload(IResolvable value)
The rule payload.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnTopicRule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnTopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnTopicRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnTopicRuleProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
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..."
@Stability(value=Stable) @NotNull public Object getTopicRulePayload()
@Stability(value=Stable)
public void setTopicRulePayload(@NotNull
CfnTopicRule.TopicRulePayloadProperty value)
@Stability(value=Stable)
public void setTopicRulePayload(@NotNull
IResolvable value)
@Stability(value=Stable) @Nullable public String getRuleName()
@Stability(value=Stable)
public void setRuleName(@Nullable
String value)
Copyright © 2022. All rights reserved.