@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-28T21:34:15.985Z") 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") // 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();
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.LocationActionProperty
Describes an action to send device location updates from an MQTT message to an Amazon Location tracker resource.
|
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.RepublishActionHeadersProperty
Specifies MQTT Version 5.0 headers information.
|
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.TimestampProperty
Describes how to interpret an application-defined timestamp value from an MQTT message payload and the precision of that value.
|
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.
|
static interface |
CfnTopicRule.UserPropertyProperty
A key-value pair that you define in the header.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnTopicRule(Construct scope,
java.lang.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 |
---|---|
java.lang.String |
getAttrArn()
The Amazon Resource Name (ARN) of the AWS IoT rule, such as `arn:aws:iot:us-east-2:123456789012:rule/MyIoTRule` .
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getRuleName()
The name of the rule.
|
TagManager |
getTags()
Metadata which can be used to manage the topic rule.
|
java.lang.Object |
getTopicRulePayload()
The rule payload.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setRuleName(java.lang.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, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnTopicRule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnTopicRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnTopicRule(Construct scope, java.lang.String id, 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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
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..."
public java.lang.Object getTopicRulePayload()
public void setTopicRulePayload(IResolvable value)
public void setTopicRulePayload(CfnTopicRule.TopicRulePayloadProperty value)
public java.lang.String getRuleName()
public void setRuleName(java.lang.String value)