CfnTopicRule
- class aws_cdk.aws_iot.CfnTopicRule(scope, id, *, topic_rule_payload, rule_name=None, tags=None)
Bases:
CfnResource
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 .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-topicrule.html
- CloudformationResource:
AWS::IoT::TopicRule
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot cfn_topic_rule = iot.CfnTopicRule(self, "MyCfnTopicRule", topic_rule_payload=iot.CfnTopicRule.TopicRulePayloadProperty( actions=[iot.CfnTopicRule.ActionProperty( cloudwatch_alarm=iot.CfnTopicRule.CloudwatchAlarmActionProperty( alarm_name="alarmName", role_arn="roleArn", state_reason="stateReason", state_value="stateValue" ), cloudwatch_logs=iot.CfnTopicRule.CloudwatchLogsActionProperty( log_group_name="logGroupName", role_arn="roleArn", # the properties below are optional batch_mode=False ), cloudwatch_metric=iot.CfnTopicRule.CloudwatchMetricActionProperty( metric_name="metricName", metric_namespace="metricNamespace", metric_unit="metricUnit", metric_value="metricValue", role_arn="roleArn", # the properties below are optional metric_timestamp="metricTimestamp" ), dynamo_db=iot.CfnTopicRule.DynamoDBActionProperty( hash_key_field="hashKeyField", hash_key_value="hashKeyValue", role_arn="roleArn", table_name="tableName", # the properties below are optional hash_key_type="hashKeyType", payload_field="payloadField", range_key_field="rangeKeyField", range_key_type="rangeKeyType", range_key_value="rangeKeyValue" ), dynamo_dBv2=iot.CfnTopicRule.DynamoDBv2ActionProperty( put_item=iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" ), role_arn="roleArn" ), elasticsearch=iot.CfnTopicRule.ElasticsearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), firehose=iot.CfnTopicRule.FirehoseActionProperty( delivery_stream_name="deliveryStreamName", role_arn="roleArn", # the properties below are optional batch_mode=False, separator="separator" ), http=iot.CfnTopicRule.HttpActionProperty( url="url", # the properties below are optional auth=iot.CfnTopicRule.HttpAuthorizationProperty( sigv4=iot.CfnTopicRule.SigV4AuthorizationProperty( role_arn="roleArn", service_name="serviceName", signing_region="signingRegion" ) ), confirmation_url="confirmationUrl", headers=[iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )] ), iot_analytics=iot.CfnTopicRule.IotAnalyticsActionProperty( channel_name="channelName", role_arn="roleArn", # the properties below are optional batch_mode=False ), iot_events=iot.CfnTopicRule.IotEventsActionProperty( input_name="inputName", role_arn="roleArn", # the properties below are optional batch_mode=False, message_id="messageId" ), iot_site_wise=iot.CfnTopicRule.IotSiteWiseActionProperty( put_asset_property_value_entries=[iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )], role_arn="roleArn" ), kafka=iot.CfnTopicRule.KafkaActionProperty( client_properties={ "client_properties_key": "clientProperties" }, destination_arn="destinationArn", topic="topic", # the properties below are optional headers=[iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )], key="key", partition="partition" ), kinesis=iot.CfnTopicRule.KinesisActionProperty( role_arn="roleArn", stream_name="streamName", # the properties below are optional partition_key="partitionKey" ), lambda_=iot.CfnTopicRule.LambdaActionProperty( function_arn="functionArn" ), location=iot.CfnTopicRule.LocationActionProperty( device_id="deviceId", latitude="latitude", longitude="longitude", role_arn="roleArn", tracker_name="trackerName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" ) ), open_search=iot.CfnTopicRule.OpenSearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), republish=iot.CfnTopicRule.RepublishActionProperty( role_arn="roleArn", topic="topic", # the properties below are optional headers=iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] ), qos=123 ), s3=iot.CfnTopicRule.S3ActionProperty( bucket_name="bucketName", key="key", role_arn="roleArn", # the properties below are optional canned_acl="cannedAcl" ), sns=iot.CfnTopicRule.SnsActionProperty( role_arn="roleArn", target_arn="targetArn", # the properties below are optional message_format="messageFormat" ), sqs=iot.CfnTopicRule.SqsActionProperty( queue_url="queueUrl", role_arn="roleArn", # the properties below are optional use_base64=False ), step_functions=iot.CfnTopicRule.StepFunctionsActionProperty( role_arn="roleArn", state_machine_name="stateMachineName", # the properties below are optional execution_name_prefix="executionNamePrefix" ), timestream=iot.CfnTopicRule.TimestreamActionProperty( database_name="databaseName", dimensions=[iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )], role_arn="roleArn", table_name="tableName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" ) ) )], sql="sql", # the properties below are optional aws_iot_sql_version="awsIotSqlVersion", description="description", error_action=iot.CfnTopicRule.ActionProperty( cloudwatch_alarm=iot.CfnTopicRule.CloudwatchAlarmActionProperty( alarm_name="alarmName", role_arn="roleArn", state_reason="stateReason", state_value="stateValue" ), cloudwatch_logs=iot.CfnTopicRule.CloudwatchLogsActionProperty( log_group_name="logGroupName", role_arn="roleArn", # the properties below are optional batch_mode=False ), cloudwatch_metric=iot.CfnTopicRule.CloudwatchMetricActionProperty( metric_name="metricName", metric_namespace="metricNamespace", metric_unit="metricUnit", metric_value="metricValue", role_arn="roleArn", # the properties below are optional metric_timestamp="metricTimestamp" ), dynamo_db=iot.CfnTopicRule.DynamoDBActionProperty( hash_key_field="hashKeyField", hash_key_value="hashKeyValue", role_arn="roleArn", table_name="tableName", # the properties below are optional hash_key_type="hashKeyType", payload_field="payloadField", range_key_field="rangeKeyField", range_key_type="rangeKeyType", range_key_value="rangeKeyValue" ), dynamo_dBv2=iot.CfnTopicRule.DynamoDBv2ActionProperty( put_item=iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" ), role_arn="roleArn" ), elasticsearch=iot.CfnTopicRule.ElasticsearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), firehose=iot.CfnTopicRule.FirehoseActionProperty( delivery_stream_name="deliveryStreamName", role_arn="roleArn", # the properties below are optional batch_mode=False, separator="separator" ), http=iot.CfnTopicRule.HttpActionProperty( url="url", # the properties below are optional auth=iot.CfnTopicRule.HttpAuthorizationProperty( sigv4=iot.CfnTopicRule.SigV4AuthorizationProperty( role_arn="roleArn", service_name="serviceName", signing_region="signingRegion" ) ), confirmation_url="confirmationUrl", headers=[iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )] ), iot_analytics=iot.CfnTopicRule.IotAnalyticsActionProperty( channel_name="channelName", role_arn="roleArn", # the properties below are optional batch_mode=False ), iot_events=iot.CfnTopicRule.IotEventsActionProperty( input_name="inputName", role_arn="roleArn", # the properties below are optional batch_mode=False, message_id="messageId" ), iot_site_wise=iot.CfnTopicRule.IotSiteWiseActionProperty( put_asset_property_value_entries=[iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )], role_arn="roleArn" ), kafka=iot.CfnTopicRule.KafkaActionProperty( client_properties={ "client_properties_key": "clientProperties" }, destination_arn="destinationArn", topic="topic", # the properties below are optional headers=[iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )], key="key", partition="partition" ), kinesis=iot.CfnTopicRule.KinesisActionProperty( role_arn="roleArn", stream_name="streamName", # the properties below are optional partition_key="partitionKey" ), lambda_=iot.CfnTopicRule.LambdaActionProperty( function_arn="functionArn" ), location=iot.CfnTopicRule.LocationActionProperty( device_id="deviceId", latitude="latitude", longitude="longitude", role_arn="roleArn", tracker_name="trackerName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" ) ), open_search=iot.CfnTopicRule.OpenSearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), republish=iot.CfnTopicRule.RepublishActionProperty( role_arn="roleArn", topic="topic", # the properties below are optional headers=iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] ), qos=123 ), s3=iot.CfnTopicRule.S3ActionProperty( bucket_name="bucketName", key="key", role_arn="roleArn", # the properties below are optional canned_acl="cannedAcl" ), sns=iot.CfnTopicRule.SnsActionProperty( role_arn="roleArn", target_arn="targetArn", # the properties below are optional message_format="messageFormat" ), sqs=iot.CfnTopicRule.SqsActionProperty( queue_url="queueUrl", role_arn="roleArn", # the properties below are optional use_base64=False ), step_functions=iot.CfnTopicRule.StepFunctionsActionProperty( role_arn="roleArn", state_machine_name="stateMachineName", # the properties below are optional execution_name_prefix="executionNamePrefix" ), timestream=iot.CfnTopicRule.TimestreamActionProperty( database_name="databaseName", dimensions=[iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )], role_arn="roleArn", table_name="tableName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" ) ) ), rule_disabled=False ), # the properties below are optional rule_name="ruleName", tags=[CfnTag( key="key", value="value" )] )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).topic_rule_payload (
Union
[IResolvable
,TopicRulePayloadProperty
,Dict
[str
,Any
]]) – The rule payload.rule_name (
Optional
[str
]) – The name of the rule. Pattern :^[a-zA-Z0-9_]+$
tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – Metadata which can be used to manage the topic rule. .. epigraph:: 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…”
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::IoT::TopicRule'
- attr_arn
The Amazon Resource Name (ARN) of the AWS IoT rule, such as
arn:aws:iot:us-east-2:123456789012:rule/MyIoTRule
.- CloudformationAttribute:
Arn
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- node
The tree node.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- rule_name
The name of the rule.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
Metadata which can be used to manage the topic rule.
- topic_rule_payload
The rule payload.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
ActionProperty
- class CfnTopicRule.ActionProperty(*, cloudwatch_alarm=None, cloudwatch_logs=None, cloudwatch_metric=None, dynamo_db=None, dynamo_d_bv2=None, elasticsearch=None, firehose=None, http=None, iot_analytics=None, iot_events=None, iot_site_wise=None, kafka=None, kinesis=None, lambda_=None, location=None, open_search=None, republish=None, s3=None, sns=None, sqs=None, step_functions=None, timestream=None)
Bases:
object
Describes the actions associated with a rule.
- Parameters:
cloudwatch_alarm (
Union
[IResolvable
,CloudwatchAlarmActionProperty
,Dict
[str
,Any
],None
]) – Change the state of a CloudWatch alarm.cloudwatch_logs (
Union
[IResolvable
,CloudwatchLogsActionProperty
,Dict
[str
,Any
],None
]) – Sends data to CloudWatch.cloudwatch_metric (
Union
[IResolvable
,CloudwatchMetricActionProperty
,Dict
[str
,Any
],None
]) – Capture a CloudWatch metric.dynamo_db (
Union
[IResolvable
,DynamoDBActionProperty
,Dict
[str
,Any
],None
]) – Write to a DynamoDB table.dynamo_d_bv2 (
Union
[IResolvable
,DynamoDBv2ActionProperty
,Dict
[str
,Any
],None
]) – Write to a DynamoDB table. This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.elasticsearch (
Union
[IResolvable
,ElasticsearchActionProperty
,Dict
[str
,Any
],None
]) – Write data to an Amazon OpenSearch Service domain. .. epigraph:: TheElasticsearch
action can only be used by existing rule actions. To create a new rule action or to update an existing rule action, use theOpenSearch
rule action instead. For more information, see OpenSearchAction .firehose (
Union
[IResolvable
,FirehoseActionProperty
,Dict
[str
,Any
],None
]) – Write to an Amazon Kinesis Firehose stream.http (
Union
[IResolvable
,HttpActionProperty
,Dict
[str
,Any
],None
]) – Send data to an HTTPS endpoint.iot_analytics (
Union
[IResolvable
,IotAnalyticsActionProperty
,Dict
[str
,Any
],None
]) – Sends message data to an AWS IoT Analytics channel.iot_events (
Union
[IResolvable
,IotEventsActionProperty
,Dict
[str
,Any
],None
]) – Sends an input to an AWS IoT Events detector.iot_site_wise (
Union
[IResolvable
,IotSiteWiseActionProperty
,Dict
[str
,Any
],None
]) – Sends data from the MQTT message that triggered the rule to AWS IoT SiteWise asset properties.kafka (
Union
[IResolvable
,KafkaActionProperty
,Dict
[str
,Any
],None
]) – Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.kinesis (
Union
[IResolvable
,KinesisActionProperty
,Dict
[str
,Any
],None
]) – Write data to an Amazon Kinesis stream.lambda – Invoke a Lambda function.
location (
Union
[IResolvable
,LocationActionProperty
,Dict
[str
,Any
],None
]) – Sends device location data to Amazon Location Service .open_search (
Union
[IResolvable
,OpenSearchActionProperty
,Dict
[str
,Any
],None
]) – Write data to an Amazon OpenSearch Service domain.republish (
Union
[IResolvable
,RepublishActionProperty
,Dict
[str
,Any
],None
]) – Publish to another MQTT topic.s3 (
Union
[IResolvable
,S3ActionProperty
,Dict
[str
,Any
],None
]) – Write to an Amazon S3 bucket.sns (
Union
[IResolvable
,SnsActionProperty
,Dict
[str
,Any
],None
]) – Publish to an Amazon SNS topic.sqs (
Union
[IResolvable
,SqsActionProperty
,Dict
[str
,Any
],None
]) – Publish to an Amazon SQS queue.step_functions (
Union
[IResolvable
,StepFunctionsActionProperty
,Dict
[str
,Any
],None
]) – Starts execution of a Step Functions state machine.timestream (
Union
[IResolvable
,TimestreamActionProperty
,Dict
[str
,Any
],None
]) – Writes attributes from an MQTT message.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot action_property = iot.CfnTopicRule.ActionProperty( cloudwatch_alarm=iot.CfnTopicRule.CloudwatchAlarmActionProperty( alarm_name="alarmName", role_arn="roleArn", state_reason="stateReason", state_value="stateValue" ), cloudwatch_logs=iot.CfnTopicRule.CloudwatchLogsActionProperty( log_group_name="logGroupName", role_arn="roleArn", # the properties below are optional batch_mode=False ), cloudwatch_metric=iot.CfnTopicRule.CloudwatchMetricActionProperty( metric_name="metricName", metric_namespace="metricNamespace", metric_unit="metricUnit", metric_value="metricValue", role_arn="roleArn", # the properties below are optional metric_timestamp="metricTimestamp" ), dynamo_db=iot.CfnTopicRule.DynamoDBActionProperty( hash_key_field="hashKeyField", hash_key_value="hashKeyValue", role_arn="roleArn", table_name="tableName", # the properties below are optional hash_key_type="hashKeyType", payload_field="payloadField", range_key_field="rangeKeyField", range_key_type="rangeKeyType", range_key_value="rangeKeyValue" ), dynamo_dBv2=iot.CfnTopicRule.DynamoDBv2ActionProperty( put_item=iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" ), role_arn="roleArn" ), elasticsearch=iot.CfnTopicRule.ElasticsearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), firehose=iot.CfnTopicRule.FirehoseActionProperty( delivery_stream_name="deliveryStreamName", role_arn="roleArn", # the properties below are optional batch_mode=False, separator="separator" ), http=iot.CfnTopicRule.HttpActionProperty( url="url", # the properties below are optional auth=iot.CfnTopicRule.HttpAuthorizationProperty( sigv4=iot.CfnTopicRule.SigV4AuthorizationProperty( role_arn="roleArn", service_name="serviceName", signing_region="signingRegion" ) ), confirmation_url="confirmationUrl", headers=[iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )] ), iot_analytics=iot.CfnTopicRule.IotAnalyticsActionProperty( channel_name="channelName", role_arn="roleArn", # the properties below are optional batch_mode=False ), iot_events=iot.CfnTopicRule.IotEventsActionProperty( input_name="inputName", role_arn="roleArn", # the properties below are optional batch_mode=False, message_id="messageId" ), iot_site_wise=iot.CfnTopicRule.IotSiteWiseActionProperty( put_asset_property_value_entries=[iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )], role_arn="roleArn" ), kafka=iot.CfnTopicRule.KafkaActionProperty( client_properties={ "client_properties_key": "clientProperties" }, destination_arn="destinationArn", topic="topic", # the properties below are optional headers=[iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )], key="key", partition="partition" ), kinesis=iot.CfnTopicRule.KinesisActionProperty( role_arn="roleArn", stream_name="streamName", # the properties below are optional partition_key="partitionKey" ), lambda_=iot.CfnTopicRule.LambdaActionProperty( function_arn="functionArn" ), location=iot.CfnTopicRule.LocationActionProperty( device_id="deviceId", latitude="latitude", longitude="longitude", role_arn="roleArn", tracker_name="trackerName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" ) ), open_search=iot.CfnTopicRule.OpenSearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), republish=iot.CfnTopicRule.RepublishActionProperty( role_arn="roleArn", topic="topic", # the properties below are optional headers=iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] ), qos=123 ), s3=iot.CfnTopicRule.S3ActionProperty( bucket_name="bucketName", key="key", role_arn="roleArn", # the properties below are optional canned_acl="cannedAcl" ), sns=iot.CfnTopicRule.SnsActionProperty( role_arn="roleArn", target_arn="targetArn", # the properties below are optional message_format="messageFormat" ), sqs=iot.CfnTopicRule.SqsActionProperty( queue_url="queueUrl", role_arn="roleArn", # the properties below are optional use_base64=False ), step_functions=iot.CfnTopicRule.StepFunctionsActionProperty( role_arn="roleArn", state_machine_name="stateMachineName", # the properties below are optional execution_name_prefix="executionNamePrefix" ), timestream=iot.CfnTopicRule.TimestreamActionProperty( database_name="databaseName", dimensions=[iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )], role_arn="roleArn", table_name="tableName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" ) ) )
Attributes
- cloudwatch_alarm
Change the state of a CloudWatch alarm.
- cloudwatch_logs
Sends data to CloudWatch.
- cloudwatch_metric
Capture a CloudWatch metric.
- dynamo_d_bv2
Write to a DynamoDB table.
This is a new version of the DynamoDB action. It allows you to write each attribute in an MQTT message payload into a separate DynamoDB column.
- dynamo_db
Write to a DynamoDB table.
- elasticsearch
Write data to an Amazon OpenSearch Service domain.
The
Elasticsearch
action can only be used by existing rule actions. To create a new rule action or to update an existing rule action, use theOpenSearch
rule action instead. For more information, see OpenSearchAction .
- firehose
Write to an Amazon Kinesis Firehose stream.
- http
Send data to an HTTPS endpoint.
- iot_analytics
Sends message data to an AWS IoT Analytics channel.
- iot_events
Sends an input to an AWS IoT Events detector.
- iot_site_wise
Sends data from the MQTT message that triggered the rule to AWS IoT SiteWise asset properties.
- kafka
Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.
- kinesis
Write data to an Amazon Kinesis stream.
- lambda_
Invoke a Lambda function.
- location
//docs.aws.amazon.com//location/latest/developerguide/welcome.html>`_ .
- See:
- Type:
Sends device location data to `Amazon Location Service <https
- open_search
Write data to an Amazon OpenSearch Service domain.
- republish
Publish to another MQTT topic.
- s3
Write to an Amazon S3 bucket.
- sns
Publish to an Amazon SNS topic.
- sqs
Publish to an Amazon SQS queue.
- step_functions
Starts execution of a Step Functions state machine.
- timestream
Writes attributes from an MQTT message.
AssetPropertyTimestampProperty
- class CfnTopicRule.AssetPropertyTimestampProperty(*, time_in_seconds, offset_in_nanos=None)
Bases:
object
An asset property timestamp entry containing the following information.
- Parameters:
time_in_seconds (
str
) – A string that contains the time in seconds since epoch. Accepts substitution templates.offset_in_nanos (
Optional
[str
]) – Optional. A string that contains the nanosecond time offset. Accepts substitution templates.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot asset_property_timestamp_property = iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" )
Attributes
- offset_in_nanos
Optional.
A string that contains the nanosecond time offset. Accepts substitution templates.
- time_in_seconds
A string that contains the time in seconds since epoch.
Accepts substitution templates.
AssetPropertyValueProperty
- class CfnTopicRule.AssetPropertyValueProperty(*, timestamp, value, quality=None)
Bases:
object
An asset property value entry containing the following information.
- Parameters:
timestamp (
Union
[IResolvable
,AssetPropertyTimestampProperty
,Dict
[str
,Any
]]) – The asset property value timestamp.value (
Union
[IResolvable
,AssetPropertyVariantProperty
,Dict
[str
,Any
]]) – The value of the asset property.quality (
Optional
[str
]) – Optional. A string that describes the quality of the value. Accepts substitution templates. Must beGOOD
,BAD
, orUNCERTAIN
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot asset_property_value_property = iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )
Attributes
- quality
Optional.
A string that describes the quality of the value. Accepts substitution templates. Must be
GOOD
,BAD
, orUNCERTAIN
.
- timestamp
The asset property value timestamp.
- value
The value of the asset property.
AssetPropertyVariantProperty
- class CfnTopicRule.AssetPropertyVariantProperty(*, boolean_value=None, double_value=None, integer_value=None, string_value=None)
Bases:
object
Contains an asset property value (of a single type).
- Parameters:
boolean_value (
Optional
[str
]) – Optional. A string that contains the boolean value (true
orfalse
) of the value entry. Accepts substitution templates.double_value (
Optional
[str
]) – Optional. A string that contains the double value of the value entry. Accepts substitution templates.integer_value (
Optional
[str
]) – Optional. A string that contains the integer value of the value entry. Accepts substitution templates.string_value (
Optional
[str
]) – Optional. The string value of the value entry. Accepts substitution templates.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot asset_property_variant_property = iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" )
Attributes
- boolean_value
Optional.
A string that contains the boolean value (
true
orfalse
) of the value entry. Accepts substitution templates.
- double_value
Optional.
A string that contains the double value of the value entry. Accepts substitution templates.
- integer_value
Optional.
A string that contains the integer value of the value entry. Accepts substitution templates.
- string_value
Optional.
The string value of the value entry. Accepts substitution templates.
CloudwatchAlarmActionProperty
- class CfnTopicRule.CloudwatchAlarmActionProperty(*, alarm_name, role_arn, state_reason, state_value)
Bases:
object
Describes an action that updates a CloudWatch alarm.
- Parameters:
alarm_name (
str
) – The CloudWatch alarm name.role_arn (
str
) – The IAM role that allows access to the CloudWatch alarm.state_reason (
str
) – The reason for the alarm change.state_value (
str
) – The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot cloudwatch_alarm_action_property = iot.CfnTopicRule.CloudwatchAlarmActionProperty( alarm_name="alarmName", role_arn="roleArn", state_reason="stateReason", state_value="stateValue" )
Attributes
- alarm_name
The CloudWatch alarm name.
- role_arn
The IAM role that allows access to the CloudWatch alarm.
- state_reason
The reason for the alarm change.
- state_value
The value of the alarm state.
Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.
CloudwatchLogsActionProperty
- class CfnTopicRule.CloudwatchLogsActionProperty(*, log_group_name, role_arn, batch_mode=None)
Bases:
object
Describes an action that updates a CloudWatch log.
- Parameters:
log_group_name (
str
) – The CloudWatch log name.role_arn (
str
) – The IAM role that allows access to the CloudWatch log.batch_mode (
Union
[bool
,IResolvable
,None
]) – Indicates whether batches of log records will be extracted and uploaded into CloudWatch.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot cloudwatch_logs_action_property = iot.CfnTopicRule.CloudwatchLogsActionProperty( log_group_name="logGroupName", role_arn="roleArn", # the properties below are optional batch_mode=False )
Attributes
- batch_mode
Indicates whether batches of log records will be extracted and uploaded into CloudWatch.
- log_group_name
The CloudWatch log name.
- role_arn
The IAM role that allows access to the CloudWatch log.
CloudwatchMetricActionProperty
- class CfnTopicRule.CloudwatchMetricActionProperty(*, metric_name, metric_namespace, metric_unit, metric_value, role_arn, metric_timestamp=None)
Bases:
object
Describes an action that captures a CloudWatch metric.
- Parameters:
metric_name (
str
) – The CloudWatch metric name.metric_namespace (
str
) – The CloudWatch metric namespace name.metric_unit (
str
) – The metric unit supported by CloudWatch.metric_value (
str
) – The CloudWatch metric value.role_arn (
str
) – The IAM role that allows access to the CloudWatch metric.metric_timestamp (
Optional
[str
]) – An optional Unix timestamp .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot cloudwatch_metric_action_property = iot.CfnTopicRule.CloudwatchMetricActionProperty( metric_name="metricName", metric_namespace="metricNamespace", metric_unit="metricUnit", metric_value="metricValue", role_arn="roleArn", # the properties below are optional metric_timestamp="metricTimestamp" )
Attributes
- metric_name
The CloudWatch metric name.
- metric_namespace
The CloudWatch metric namespace name.
- metric_timestamp
//docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp>`_ .
- See:
- Type:
An optional `Unix timestamp <https
- metric_unit
//docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#Unit>`_ supported by CloudWatch.
- metric_value
The CloudWatch metric value.
- role_arn
The IAM role that allows access to the CloudWatch metric.
DynamoDBActionProperty
- class CfnTopicRule.DynamoDBActionProperty(*, hash_key_field, hash_key_value, role_arn, table_name, hash_key_type=None, payload_field=None, range_key_field=None, range_key_type=None, range_key_value=None)
Bases:
object
Describes an action to write to a DynamoDB table.
The
tableName
,hashKeyField
, andrangeKeyField
values must match the values used when you created the table.The
hashKeyValue
andrangeKeyvalue
fields use a substitution template syntax. These templates provide data at runtime. The syntax is as follows: ${ sql-expression }.You can specify any valid expression in a WHERE or SELECT clause, including JSON properties, comparisons, calculations, and functions. For example, the following field uses the third level of the topic:
"hashKeyValue": "${topic(3)}"
The following field uses the timestamp:
"rangeKeyValue": "${timestamp()}"
For more information, see DynamoDBv2 Action in the AWS IoT Developer Guide .
- Parameters:
hash_key_field (
str
) – The hash key name.hash_key_value (
str
) – The hash key value.role_arn (
str
) – The ARN of the IAM role that grants access to the DynamoDB table.table_name (
str
) – The name of the DynamoDB table.hash_key_type (
Optional
[str
]) – The hash key type. Valid values are “STRING” or “NUMBER”payload_field (
Optional
[str
]) – The action payload. This name can be customized.range_key_field (
Optional
[str
]) – The range key name.range_key_type (
Optional
[str
]) – The range key type. Valid values are “STRING” or “NUMBER”range_key_value (
Optional
[str
]) – The range key value.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot dynamo_dBAction_property = iot.CfnTopicRule.DynamoDBActionProperty( hash_key_field="hashKeyField", hash_key_value="hashKeyValue", role_arn="roleArn", table_name="tableName", # the properties below are optional hash_key_type="hashKeyType", payload_field="payloadField", range_key_field="rangeKeyField", range_key_type="rangeKeyType", range_key_value="rangeKeyValue" )
Attributes
- hash_key_field
The hash key name.
- hash_key_type
The hash key type.
Valid values are “STRING” or “NUMBER”
- hash_key_value
The hash key value.
- payload_field
The action payload.
This name can be customized.
- range_key_field
The range key name.
- range_key_type
The range key type.
Valid values are “STRING” or “NUMBER”
- range_key_value
The range key value.
- role_arn
The ARN of the IAM role that grants access to the DynamoDB table.
- table_name
The name of the DynamoDB table.
DynamoDBv2ActionProperty
- class CfnTopicRule.DynamoDBv2ActionProperty(*, put_item=None, role_arn=None)
Bases:
object
Describes an action to write to a DynamoDB table.
This DynamoDB action writes each attribute in the message payload into it’s own column in the DynamoDB table.
- Parameters:
put_item (
Union
[IResolvable
,PutItemInputProperty
,Dict
[str
,Any
],None
]) – Specifies the DynamoDB table to which the message data will be written. For example:.{ "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }
Each attribute in the message payload will be written to a separate column in the DynamoDB database.role_arn (
Optional
[str
]) – The ARN of the IAM role that grants access to the DynamoDB table.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot dynamo_dBv2_action_property = iot.CfnTopicRule.DynamoDBv2ActionProperty( put_item=iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" ), role_arn="roleArn" )
Attributes
- put_item
.
{ "dynamoDBv2": { "roleArn": "aws:iam:12341251:my-role" "putItem": { "tableName": "my-table" } } }
Each attribute in the message payload will be written to a separate column in the DynamoDB database.
- See:
- Type:
Specifies the DynamoDB table to which the message data will be written. For example
- role_arn
The ARN of the IAM role that grants access to the DynamoDB table.
ElasticsearchActionProperty
- class CfnTopicRule.ElasticsearchActionProperty(*, endpoint, id, index, role_arn, type)
Bases:
object
Describes an action that writes data to an Amazon OpenSearch Service domain.
The
Elasticsearch
action can only be used by existing rule actions. To create a new rule action or to update an existing rule action, use theOpenSearch
rule action instead. For more information, see OpenSearchAction .- Parameters:
endpoint (
str
) – The endpoint of your OpenSearch domain.id (
str
) – The unique identifier for the document you are storing.index (
str
) – The index where you want to store your data.role_arn (
str
) – The IAM role ARN that has access to OpenSearch.type (
str
) – The type of document you are storing.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot elasticsearch_action_property = iot.CfnTopicRule.ElasticsearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" )
Attributes
- endpoint
The endpoint of your OpenSearch domain.
- id
The unique identifier for the document you are storing.
- index
The index where you want to store your data.
- role_arn
The IAM role ARN that has access to OpenSearch.
- type
The type of document you are storing.
FirehoseActionProperty
- class CfnTopicRule.FirehoseActionProperty(*, delivery_stream_name, role_arn, batch_mode=None, separator=None)
Bases:
object
Describes an action that writes data to an Amazon Kinesis Firehose stream.
- Parameters:
delivery_stream_name (
str
) – The delivery stream name.role_arn (
str
) – The IAM role that grants access to the Amazon Kinesis Firehose stream.batch_mode (
Union
[bool
,IResolvable
,None
]) – Whether to deliver the Kinesis Data Firehose stream as a batch by using`PutRecordBatch
<https://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html>`_ . The default value isfalse
. WhenbatchMode
istrue
and the rule’s SQL statement evaluates to an Array, each Array element forms one record in the`PutRecordBatch
<https://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html>`_ request. The resulting array can’t have more than 500 records.separator (
Optional
[str
]) – A character separator that will be used to separate records written to the Firehose stream. Valid values are: ‘n’ (newline), ‘t’ (tab), ‘rn’ (Windows newline), ‘,’ (comma).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot firehose_action_property = iot.CfnTopicRule.FirehoseActionProperty( delivery_stream_name="deliveryStreamName", role_arn="roleArn", # the properties below are optional batch_mode=False, separator="separator" )
Attributes
- batch_mode
//docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html>`_ . The default value is
false
.When
batchMode
istrue
and the rule’s SQL statement evaluates to an Array, each Array element forms one record in the`PutRecordBatch
<https://docs.aws.amazon.com/firehose/latest/APIReference/API_PutRecordBatch.html>`_ request. The resulting array can’t have more than 500 records.- See:
- Type:
Whether to deliver the Kinesis Data Firehose stream as a batch by using
`PutRecordBatch
<https
- delivery_stream_name
The delivery stream name.
- role_arn
The IAM role that grants access to the Amazon Kinesis Firehose stream.
- separator
A character separator that will be used to separate records written to the Firehose stream.
Valid values are: ‘n’ (newline), ‘t’ (tab), ‘rn’ (Windows newline), ‘,’ (comma).
HttpActionHeaderProperty
- class CfnTopicRule.HttpActionHeaderProperty(*, key, value)
Bases:
object
The HTTP action header.
- Parameters:
key (
str
) – The HTTP header key.value (
str
) – The HTTP header value. Substitution templates are supported.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot http_action_header_property = iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )
Attributes
- key
The HTTP header key.
- value
The HTTP header value.
Substitution templates are supported.
HttpActionProperty
- class CfnTopicRule.HttpActionProperty(*, url, auth=None, confirmation_url=None, headers=None)
Bases:
object
Send data to an HTTPS endpoint.
- Parameters:
url (
str
) – The endpoint URL. If substitution templates are used in the URL, you must also specify aconfirmationUrl
. If this is a new destination, a newTopicRuleDestination
is created if possible.auth (
Union
[IResolvable
,HttpAuthorizationProperty
,Dict
[str
,Any
],None
]) – The authentication method to use when sending data to an HTTPS endpoint.confirmation_url (
Optional
[str
]) – The URL to which AWS IoT sends a confirmation message. The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL AWS IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.headers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,HttpActionHeaderProperty
,Dict
[str
,Any
]]],None
]) – The HTTP headers to send with the message data.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot http_action_property = iot.CfnTopicRule.HttpActionProperty( url="url", # the properties below are optional auth=iot.CfnTopicRule.HttpAuthorizationProperty( sigv4=iot.CfnTopicRule.SigV4AuthorizationProperty( role_arn="roleArn", service_name="serviceName", signing_region="signingRegion" ) ), confirmation_url="confirmationUrl", headers=[iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )] )
Attributes
- auth
The authentication method to use when sending data to an HTTPS endpoint.
- confirmation_url
The URL to which AWS IoT sends a confirmation message.
The value of the confirmation URL must be a prefix of the endpoint URL. If you do not specify a confirmation URL AWS IoT uses the endpoint URL as the confirmation URL. If you use substitution templates in the confirmationUrl, you must create and enable topic rule destinations that match each possible value of the substitution template before traffic is allowed to your endpoint URL.
- headers
The HTTP headers to send with the message data.
- url
The endpoint URL.
If substitution templates are used in the URL, you must also specify a
confirmationUrl
. If this is a new destination, a newTopicRuleDestination
is created if possible.
IotAnalyticsActionProperty
- class CfnTopicRule.IotAnalyticsActionProperty(*, channel_name, role_arn, batch_mode=None)
Bases:
object
Sends message data to an AWS IoT Analytics channel.
- Parameters:
channel_name (
str
) – The name of the IoT Analytics channel to which message data will be sent.role_arn (
str
) – The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics:BatchPutMessage).batch_mode (
Union
[bool
,IResolvable
,None
]) – Whether to process the action as a batch. The default value isfalse
. WhenbatchMode
istrue
and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by`BatchPutMessage
<https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_BatchPutMessage.html>`_ The resulting array can’t have more than 100 messages.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot iot_analytics_action_property = iot.CfnTopicRule.IotAnalyticsActionProperty( channel_name="channelName", role_arn="roleArn", # the properties below are optional batch_mode=False )
Attributes
- batch_mode
Whether to process the action as a batch. The default value is
false
.When
batchMode
istrue
and the rule SQL statement evaluates to an Array, each Array element is delivered as a separate message when passed by`BatchPutMessage
<https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_BatchPutMessage.html>`_ The resulting array can’t have more than 100 messages.
- channel_name
The name of the IoT Analytics channel to which message data will be sent.
- role_arn
BatchPutMessage).
- See:
- Type:
The ARN of the role which has a policy that grants IoT Analytics permission to send message data via IoT Analytics (iotanalytics
IotEventsActionProperty
- class CfnTopicRule.IotEventsActionProperty(*, input_name, role_arn, batch_mode=None, message_id=None)
Bases:
object
Sends an input to an AWS IoT Events detector.
- Parameters:
input_name (
str
) – The name of the AWS IoT Events input.role_arn (
str
) – The ARN of the role that grants AWS IoT permission to send an input to an AWS IoT Events detector. (“Action”:”iotevents:BatchPutMessage”).batch_mode (
Union
[bool
,IResolvable
,None
]) – Whether to process the event actions as a batch. The default value isfalse
. WhenbatchMode
istrue
, you can’t specify amessageId
. WhenbatchMode
istrue
and the rule SQL statement evaluates to an Array, each Array element is treated as a separate message when Events by calling`BatchPutMessage
<https://docs.aws.amazon.com/iotevents/latest/apireference/API_iotevents-data_BatchPutMessage.html>`_ . The resulting array can’t have more than 10 messages.message_id (
Optional
[str
]) – The ID of the message. The defaultmessageId
is a new UUID value. WhenbatchMode
istrue
, you can’t specify amessageId
–a new UUID value will be assigned. Assign a value to this property to ensure that only one input (message) with a givenmessageId
will be processed by an AWS IoT Events detector.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot iot_events_action_property = iot.CfnTopicRule.IotEventsActionProperty( input_name="inputName", role_arn="roleArn", # the properties below are optional batch_mode=False, message_id="messageId" )
Attributes
- batch_mode
Whether to process the event actions as a batch. The default value is
false
.When
batchMode
istrue
, you can’t specify amessageId
.When
batchMode
istrue
and the rule SQL statement evaluates to an Array, each Array element is treated as a separate message when Events by calling`BatchPutMessage
<https://docs.aws.amazon.com/iotevents/latest/apireference/API_iotevents-data_BatchPutMessage.html>`_ . The resulting array can’t have more than 10 messages.
- input_name
The name of the AWS IoT Events input.
- message_id
The ID of the message. The default
messageId
is a new UUID value.When
batchMode
istrue
, you can’t specify amessageId
–a new UUID value will be assigned.Assign a value to this property to ensure that only one input (message) with a given
messageId
will be processed by an AWS IoT Events detector.
- role_arn
The ARN of the role that grants AWS IoT permission to send an input to an AWS IoT Events detector.
(“Action”:”iotevents:BatchPutMessage”).
IotSiteWiseActionProperty
- class CfnTopicRule.IotSiteWiseActionProperty(*, put_asset_property_value_entries, role_arn)
Bases:
object
Describes an action to send data from an MQTT message that triggered the rule to AWS IoT SiteWise asset properties.
- Parameters:
put_asset_property_value_entries (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,PutAssetPropertyValueEntryProperty
,Dict
[str
,Any
]]]]) – A list of asset property value entries.role_arn (
str
) – The ARN of the role that grants AWS IoT permission to send an asset property value to AWS IoT SiteWise. ("Action": "iotsitewise:BatchPutAssetPropertyValue"
). The trust policy can restrict access to specific asset hierarchy paths.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot iot_site_wise_action_property = iot.CfnTopicRule.IotSiteWiseActionProperty( put_asset_property_value_entries=[iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )], role_arn="roleArn" )
Attributes
- put_asset_property_value_entries
A list of asset property value entries.
- role_arn
The ARN of the role that grants AWS IoT permission to send an asset property value to AWS IoT SiteWise.
(
"Action": "iotsitewise:BatchPutAssetPropertyValue"
). The trust policy can restrict access to specific asset hierarchy paths.
KafkaActionHeaderProperty
- class CfnTopicRule.KafkaActionHeaderProperty(*, key, value)
Bases:
object
Specifies a Kafka header using key-value pairs when you create a Rule’s Kafka Action.
You can use these headers to route data from IoT clients to downstream Kafka clusters without modifying your message payload.
- Parameters:
key (
str
) – The key of the Kafka header.value (
str
) – The value of the Kafka header.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot kafka_action_header_property = iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )
Attributes
- key
The key of the Kafka header.
- value
The value of the Kafka header.
KafkaActionProperty
- class CfnTopicRule.KafkaActionProperty(*, client_properties, destination_arn, topic, headers=None, key=None, partition=None)
Bases:
object
Send messages to an Amazon Managed Streaming for Apache Kafka (Amazon MSK) or self-managed Apache Kafka cluster.
- Parameters:
client_properties (
Union
[IResolvable
,Mapping
[str
,str
]]) – Properties of the Apache Kafka producer client.destination_arn (
str
) – The ARN of Kafka action’s VPCTopicRuleDestination
.topic (
str
) – The Kafka topic for messages to be sent to the Kafka broker.headers (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,KafkaActionHeaderProperty
,Dict
[str
,Any
]]],None
]) – The list of Kafka headers that you specify.key (
Optional
[str
]) – The Kafka message key.partition (
Optional
[str
]) – The Kafka message partition.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot kafka_action_property = iot.CfnTopicRule.KafkaActionProperty( client_properties={ "client_properties_key": "clientProperties" }, destination_arn="destinationArn", topic="topic", # the properties below are optional headers=[iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )], key="key", partition="partition" )
Attributes
- client_properties
Properties of the Apache Kafka producer client.
- destination_arn
The ARN of Kafka action’s VPC
TopicRuleDestination
.
- headers
The list of Kafka headers that you specify.
- key
The Kafka message key.
- partition
The Kafka message partition.
- topic
The Kafka topic for messages to be sent to the Kafka broker.
KinesisActionProperty
- class CfnTopicRule.KinesisActionProperty(*, role_arn, stream_name, partition_key=None)
Bases:
object
Describes an action to write data to an Amazon Kinesis stream.
- Parameters:
role_arn (
str
) – The ARN of the IAM role that grants access to the Amazon Kinesis stream.stream_name (
str
) – The name of the Amazon Kinesis stream.partition_key (
Optional
[str
]) – The partition key.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot kinesis_action_property = iot.CfnTopicRule.KinesisActionProperty( role_arn="roleArn", stream_name="streamName", # the properties below are optional partition_key="partitionKey" )
Attributes
- partition_key
The partition key.
- role_arn
The ARN of the IAM role that grants access to the Amazon Kinesis stream.
- stream_name
The name of the Amazon Kinesis stream.
LambdaActionProperty
- class CfnTopicRule.LambdaActionProperty(*, function_arn=None)
Bases:
object
Describes an action to invoke a Lambda function.
- Parameters:
function_arn (
Optional
[str
]) – The ARN of the Lambda function.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot lambda_action_property = iot.CfnTopicRule.LambdaActionProperty( function_arn="functionArn" )
Attributes
- function_arn
The ARN of the Lambda function.
LocationActionProperty
- class CfnTopicRule.LocationActionProperty(*, device_id, latitude, longitude, role_arn, tracker_name, timestamp=None)
Bases:
object
Describes an action to send device location updates from an MQTT message to an Amazon Location tracker resource.
- Parameters:
device_id (
str
) – The unique ID of the device providing the location data.latitude (
str
) – A string that evaluates to a double value that represents the latitude of the device’s location.longitude (
str
) – A string that evaluates to a double value that represents the longitude of the device’s location.role_arn (
str
) – The IAM role that grants permission to write to the Amazon Location resource.tracker_name (
str
) – The name of the tracker resource in Amazon Location in which the location is updated.timestamp (
Union
[IResolvable
,TimestampProperty
,Dict
[str
,Any
],None
]) – The time that the location data was sampled. The default value is the time the MQTT message was processed.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot location_action_property = iot.CfnTopicRule.LocationActionProperty( device_id="deviceId", latitude="latitude", longitude="longitude", role_arn="roleArn", tracker_name="trackerName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" ) )
Attributes
- device_id
The unique ID of the device providing the location data.
- latitude
A string that evaluates to a double value that represents the latitude of the device’s location.
- longitude
A string that evaluates to a double value that represents the longitude of the device’s location.
- role_arn
The IAM role that grants permission to write to the Amazon Location resource.
- timestamp
The time that the location data was sampled.
The default value is the time the MQTT message was processed.
- tracker_name
The name of the tracker resource in Amazon Location in which the location is updated.
OpenSearchActionProperty
- class CfnTopicRule.OpenSearchActionProperty(*, endpoint, id, index, role_arn, type)
Bases:
object
Describes an action that writes data to an Amazon OpenSearch Service domain.
- Parameters:
endpoint (
str
) – The endpoint of your OpenSearch domain.id (
str
) – The unique identifier for the document you are storing.index (
str
) – The OpenSearch index where you want to store your data.role_arn (
str
) – The IAM role ARN that has access to OpenSearch.type (
str
) – The type of document you are storing.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot open_search_action_property = iot.CfnTopicRule.OpenSearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" )
Attributes
- endpoint
The endpoint of your OpenSearch domain.
- id
The unique identifier for the document you are storing.
- index
The OpenSearch index where you want to store your data.
- role_arn
The IAM role ARN that has access to OpenSearch.
- type
The type of document you are storing.
PutAssetPropertyValueEntryProperty
- class CfnTopicRule.PutAssetPropertyValueEntryProperty(*, property_values, asset_id=None, entry_id=None, property_alias=None, property_id=None)
Bases:
object
An asset property value entry containing the following information.
- Parameters:
property_values (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,AssetPropertyValueProperty
,Dict
[str
,Any
]]]]) – A list of property values to insert that each contain timestamp, quality, and value (TQV) information.asset_id (
Optional
[str
]) – The ID of the AWS IoT SiteWise asset. You must specify either apropertyAlias
or both analiasId
and apropertyId
. Accepts substitution templates.entry_id (
Optional
[str
]) – Optional. A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.property_alias (
Optional
[str
]) – The name of the property alias associated with your asset property. You must specify either apropertyAlias
or both analiasId
and apropertyId
. Accepts substitution templates.property_id (
Optional
[str
]) – The ID of the asset’s property. You must specify either apropertyAlias
or both analiasId
and apropertyId
. Accepts substitution templates.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot put_asset_property_value_entry_property = iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )
Attributes
- asset_id
The ID of the AWS IoT SiteWise asset.
You must specify either a
propertyAlias
or both analiasId
and apropertyId
. Accepts substitution templates.
- entry_id
Optional.
A unique identifier for this entry that you can define to better track which message caused an error in case of failure. Accepts substitution templates. Defaults to a new UUID.
- property_alias
The name of the property alias associated with your asset property.
You must specify either a
propertyAlias
or both analiasId
and apropertyId
. Accepts substitution templates.
- property_id
The ID of the asset’s property.
You must specify either a
propertyAlias
or both analiasId
and apropertyId
. Accepts substitution templates.
- property_values
A list of property values to insert that each contain timestamp, quality, and value (TQV) information.
PutItemInputProperty
- class CfnTopicRule.PutItemInputProperty(*, table_name)
Bases:
object
The input for the DynamoActionVS action that specifies the DynamoDB table to which the message data will be written.
- Parameters:
table_name (
str
) – The table where the message data will be written.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot put_item_input_property = iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" )
Attributes
- table_name
The table where the message data will be written.
RepublishActionHeadersProperty
- class CfnTopicRule.RepublishActionHeadersProperty(*, content_type=None, correlation_data=None, message_expiry=None, payload_format_indicator=None, response_topic=None, user_properties=None)
Bases:
object
Specifies MQTT Version 5.0 headers information. For more information, see MQTT in the IoT Core Developer Guide.
- Parameters:
content_type (
Optional
[str
]) – A UTF-8 encoded string that describes the content of the publishing message. For more information, see Content Type in the MQTT Version 5.0 specification. Supports substitution templates .correlation_data (
Optional
[str
]) –The base64-encoded binary data used by the sender of the request message to identify which request the response message is for. For more information, see Correlation Data in the MQTT Version 5.0 specification. Supports substitution templates . .. epigraph:: This binary data must be base64-encoded.
message_expiry (
Optional
[str
]) –A user-defined integer value that represents the message expiry interval at the broker. If the messages haven’t been sent to the subscribers within that interval, the message expires and is removed. The value of
messageExpiry
represents the number of seconds before it expires. For more information about the limits ofmessageExpiry
, see Message broker and protocol limits and quotas in the IoT Core Reference Guide. Supports substitution templates .payload_format_indicator (
Optional
[str
]) –An
Enum
string value that indicates whether the payload is formatted as UTF-8. Valid values areUNSPECIFIED_BYTES
andUTF8_DATA
. For more information, see Payload Format Indicator from the MQTT Version 5.0 specification. Supports substitution templates .response_topic (
Optional
[str
]) –A UTF-8 encoded string that’s used as the topic name for a response message. The response topic is used to describe the topic to which the receiver should publish as part of the request-response flow. The topic must not contain wildcard characters. For more information, see Response Topic in the MQTT Version 5.0 specification. Supports substitution templates .
user_properties (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,UserPropertyProperty
,Dict
[str
,Any
]]],None
]) – An array of key-value pairs that you define in the MQTT5 header.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot republish_action_headers_property = iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] )
Attributes
- content_type
A UTF-8 encoded string that describes the content of the publishing message.
For more information, see Content Type in the MQTT Version 5.0 specification.
Supports substitution templates .
- correlation_data
The base64-encoded binary data used by the sender of the request message to identify which request the response message is for.
For more information, see Correlation Data in the MQTT Version 5.0 specification.
Supports substitution templates . .. epigraph:
This binary data must be base64-encoded.
- message_expiry
A user-defined integer value that represents the message expiry interval at the broker.
If the messages haven’t been sent to the subscribers within that interval, the message expires and is removed. The value of
messageExpiry
represents the number of seconds before it expires. For more information about the limits ofmessageExpiry
, see Message broker and protocol limits and quotas in the IoT Core Reference Guide.Supports substitution templates .
- payload_format_indicator
An
Enum
string value that indicates whether the payload is formatted as UTF-8.Valid values are
UNSPECIFIED_BYTES
andUTF8_DATA
.For more information, see Payload Format Indicator from the MQTT Version 5.0 specification.
Supports substitution templates .
- response_topic
A UTF-8 encoded string that’s used as the topic name for a response message.
The response topic is used to describe the topic to which the receiver should publish as part of the request-response flow. The topic must not contain wildcard characters.
For more information, see Response Topic in the MQTT Version 5.0 specification.
Supports substitution templates .
- user_properties
An array of key-value pairs that you define in the MQTT5 header.
RepublishActionProperty
- class CfnTopicRule.RepublishActionProperty(*, role_arn, topic, headers=None, qos=None)
Bases:
object
Describes an action to republish to another topic.
- Parameters:
role_arn (
str
) – The ARN of the IAM role that grants access.topic (
str
) – The name of the MQTT topic.headers (
Union
[IResolvable
,RepublishActionHeadersProperty
,Dict
[str
,Any
],None
]) –MQTT Version 5.0 headers information. For more information, see MQTT in the IoT Core Developer Guide.
qos (
Union
[int
,float
,None
]) – The Quality of Service (QoS) level to use when republishing messages. The default value is 0.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot republish_action_property = iot.CfnTopicRule.RepublishActionProperty( role_arn="roleArn", topic="topic", # the properties below are optional headers=iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] ), qos=123 )
Attributes
- headers
//docs.aws.amazon.com//iot/latest/developerguide/mqtt.html>`_ in the IoT Core Developer Guide.
- See:
- Type:
MQTT Version 5.0 headers information. For more information, see `MQTT <https
- qos
The Quality of Service (QoS) level to use when republishing messages.
The default value is 0.
- role_arn
The ARN of the IAM role that grants access.
- topic
The name of the MQTT topic.
S3ActionProperty
- class CfnTopicRule.S3ActionProperty(*, bucket_name, key, role_arn, canned_acl=None)
Bases:
object
Describes an action to write data to an Amazon S3 bucket.
- Parameters:
bucket_name (
str
) – The Amazon S3 bucket.key (
str
) – The object key. For more information, see Actions, resources, and condition keys for Amazon S3 .role_arn (
str
) – The ARN of the IAM role that grants access.canned_acl (
Optional
[str
]) – The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot s3_action_property = iot.CfnTopicRule.S3ActionProperty( bucket_name="bucketName", key="key", role_arn="roleArn", # the properties below are optional canned_acl="cannedAcl" )
Attributes
- bucket_name
The Amazon S3 bucket.
- canned_acl
The Amazon S3 canned ACL that controls access to the object identified by the object key.
For more information, see S3 canned ACLs .
- key
The object key.
For more information, see Actions, resources, and condition keys for Amazon S3 .
- role_arn
The ARN of the IAM role that grants access.
SnsActionProperty
- class CfnTopicRule.SnsActionProperty(*, role_arn, target_arn, message_format=None)
Bases:
object
Describes an action to publish to an Amazon SNS topic.
- Parameters:
role_arn (
str
) – The ARN of the IAM role that grants access.target_arn (
str
) – The ARN of the SNS topic.message_format (
Optional
[str
]) – (Optional) The message format of the message to publish. Accepted values are “JSON” and “RAW”. The default value of the attribute is “RAW”. SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. For more information, see Amazon SNS Message and JSON Formats in the Amazon Simple Notification Service Developer Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot sns_action_property = iot.CfnTopicRule.SnsActionProperty( role_arn="roleArn", target_arn="targetArn", # the properties below are optional message_format="messageFormat" )
Attributes
- message_format
(Optional) The message format of the message to publish.
Accepted values are “JSON” and “RAW”. The default value of the attribute is “RAW”. SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. For more information, see Amazon SNS Message and JSON Formats in the Amazon Simple Notification Service Developer Guide .
- role_arn
The ARN of the IAM role that grants access.
- target_arn
The ARN of the SNS topic.
SqsActionProperty
- class CfnTopicRule.SqsActionProperty(*, queue_url, role_arn, use_base64=None)
Bases:
object
Describes an action to publish data to an Amazon SQS queue.
- Parameters:
queue_url (
str
) – The URL of the Amazon SQS queue.role_arn (
str
) – The ARN of the IAM role that grants access.use_base64 (
Union
[bool
,IResolvable
,None
]) – Specifies whether to use Base64 encoding.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot sqs_action_property = iot.CfnTopicRule.SqsActionProperty( queue_url="queueUrl", role_arn="roleArn", # the properties below are optional use_base64=False )
Attributes
- queue_url
The URL of the Amazon SQS queue.
- role_arn
The ARN of the IAM role that grants access.
- use_base64
Specifies whether to use Base64 encoding.
StepFunctionsActionProperty
- class CfnTopicRule.StepFunctionsActionProperty(*, role_arn, state_machine_name, execution_name_prefix=None)
Bases:
object
Starts execution of a Step Functions state machine.
- Parameters:
role_arn (
str
) – The ARN of the role that grants IoT permission to start execution of a state machine (“Action”:”states:StartExecution”).state_machine_name (
str
) – The name of the Step Functions state machine whose execution will be started.execution_name_prefix (
Optional
[str
]) – (Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID. Step Functions automatically creates a unique name for each state machine execution if one is not provided.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot step_functions_action_property = iot.CfnTopicRule.StepFunctionsActionProperty( role_arn="roleArn", state_machine_name="stateMachineName", # the properties below are optional execution_name_prefix="executionNamePrefix" )
Attributes
- execution_name_prefix
(Optional) A name will be given to the state machine execution consisting of this prefix followed by a UUID.
Step Functions automatically creates a unique name for each state machine execution if one is not provided.
- role_arn
StartExecution”).
- See:
- Type:
The ARN of the role that grants IoT permission to start execution of a state machine (“Action”
- Type:
“states
- state_machine_name
The name of the Step Functions state machine whose execution will be started.
TimestampProperty
- class CfnTopicRule.TimestampProperty(*, value, unit=None)
Bases:
object
Describes how to interpret an application-defined timestamp value from an MQTT message payload and the precision of that value.
- Parameters:
value (
str
) – An expression that returns a long epoch time value.unit (
Optional
[str
]) – The precision of the timestamp value that results from the expression described invalue
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot timestamp_property = iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" )
Attributes
- unit
The precision of the timestamp value that results from the expression described in
value
.
- value
An expression that returns a long epoch time value.
TimestreamActionProperty
- class CfnTopicRule.TimestreamActionProperty(*, database_name, dimensions, role_arn, table_name, timestamp=None)
Bases:
object
Describes an action that writes records into an Amazon Timestream table.
- Parameters:
database_name (
str
) – The name of an Amazon Timestream database that has the table to write records into.dimensions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TimestreamDimensionProperty
,Dict
[str
,Any
]]]]) – Metadata attributes of the time series that are written in each measure record.role_arn (
str
) – The Amazon Resource Name (ARN) of the role that grants AWS IoT permission to write to the Timestream database table.table_name (
str
) – The table where the message data will be written.timestamp (
Union
[IResolvable
,TimestreamTimestampProperty
,Dict
[str
,Any
],None
]) – The value to use for the entry’s timestamp. If blank, the time that the entry was processed is used.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot timestream_action_property = iot.CfnTopicRule.TimestreamActionProperty( database_name="databaseName", dimensions=[iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )], role_arn="roleArn", table_name="tableName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" ) )
Attributes
- database_name
The name of an Amazon Timestream database that has the table to write records into.
- dimensions
Metadata attributes of the time series that are written in each measure record.
- role_arn
The Amazon Resource Name (ARN) of the role that grants AWS IoT permission to write to the Timestream database table.
- table_name
The table where the message data will be written.
- timestamp
The value to use for the entry’s timestamp.
If blank, the time that the entry was processed is used.
TimestreamDimensionProperty
- class CfnTopicRule.TimestreamDimensionProperty(*, name, value)
Bases:
object
Metadata attributes of the time series that are written in each measure record.
- Parameters:
name (
str
) – The metadata dimension name. This is the name of the column in the Amazon Timestream database table record.value (
str
) – The value to write in this column of the database record.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot timestream_dimension_property = iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )
Attributes
- name
The metadata dimension name.
This is the name of the column in the Amazon Timestream database table record.
- value
The value to write in this column of the database record.
TimestreamTimestampProperty
- class CfnTopicRule.TimestreamTimestampProperty(*, unit, value)
Bases:
object
The value to use for the entry’s timestamp.
If blank, the time that the entry was processed is used.
- Parameters:
unit (
str
) – The precision of the timestamp value that results from the expression described invalue
.value (
str
) – An expression that returns a long epoch time value.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot timestream_timestamp_property = iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" )
Attributes
- unit
The precision of the timestamp value that results from the expression described in
value
.
- value
An expression that returns a long epoch time value.
TopicRulePayloadProperty
- class CfnTopicRule.TopicRulePayloadProperty(*, actions, sql, aws_iot_sql_version=None, description=None, error_action=None, rule_disabled=None)
Bases:
object
Describes a rule.
- Parameters:
actions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ActionProperty
,Dict
[str
,Any
]]]]) – The actions associated with the rule.sql (
str
) – The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide .aws_iot_sql_version (
Optional
[str
]) – The version of the SQL rules engine to use when evaluating the rule. The default value is 2015-10-08.description (
Optional
[str
]) – The description of the rule.error_action (
Union
[IResolvable
,ActionProperty
,Dict
[str
,Any
],None
]) – The action to take when an error occurs.rule_disabled (
Union
[bool
,IResolvable
,None
]) – Specifies whether the rule is disabled.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot topic_rule_payload_property = iot.CfnTopicRule.TopicRulePayloadProperty( actions=[iot.CfnTopicRule.ActionProperty( cloudwatch_alarm=iot.CfnTopicRule.CloudwatchAlarmActionProperty( alarm_name="alarmName", role_arn="roleArn", state_reason="stateReason", state_value="stateValue" ), cloudwatch_logs=iot.CfnTopicRule.CloudwatchLogsActionProperty( log_group_name="logGroupName", role_arn="roleArn", # the properties below are optional batch_mode=False ), cloudwatch_metric=iot.CfnTopicRule.CloudwatchMetricActionProperty( metric_name="metricName", metric_namespace="metricNamespace", metric_unit="metricUnit", metric_value="metricValue", role_arn="roleArn", # the properties below are optional metric_timestamp="metricTimestamp" ), dynamo_db=iot.CfnTopicRule.DynamoDBActionProperty( hash_key_field="hashKeyField", hash_key_value="hashKeyValue", role_arn="roleArn", table_name="tableName", # the properties below are optional hash_key_type="hashKeyType", payload_field="payloadField", range_key_field="rangeKeyField", range_key_type="rangeKeyType", range_key_value="rangeKeyValue" ), dynamo_dBv2=iot.CfnTopicRule.DynamoDBv2ActionProperty( put_item=iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" ), role_arn="roleArn" ), elasticsearch=iot.CfnTopicRule.ElasticsearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), firehose=iot.CfnTopicRule.FirehoseActionProperty( delivery_stream_name="deliveryStreamName", role_arn="roleArn", # the properties below are optional batch_mode=False, separator="separator" ), http=iot.CfnTopicRule.HttpActionProperty( url="url", # the properties below are optional auth=iot.CfnTopicRule.HttpAuthorizationProperty( sigv4=iot.CfnTopicRule.SigV4AuthorizationProperty( role_arn="roleArn", service_name="serviceName", signing_region="signingRegion" ) ), confirmation_url="confirmationUrl", headers=[iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )] ), iot_analytics=iot.CfnTopicRule.IotAnalyticsActionProperty( channel_name="channelName", role_arn="roleArn", # the properties below are optional batch_mode=False ), iot_events=iot.CfnTopicRule.IotEventsActionProperty( input_name="inputName", role_arn="roleArn", # the properties below are optional batch_mode=False, message_id="messageId" ), iot_site_wise=iot.CfnTopicRule.IotSiteWiseActionProperty( put_asset_property_value_entries=[iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )], role_arn="roleArn" ), kafka=iot.CfnTopicRule.KafkaActionProperty( client_properties={ "client_properties_key": "clientProperties" }, destination_arn="destinationArn", topic="topic", # the properties below are optional headers=[iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )], key="key", partition="partition" ), kinesis=iot.CfnTopicRule.KinesisActionProperty( role_arn="roleArn", stream_name="streamName", # the properties below are optional partition_key="partitionKey" ), lambda_=iot.CfnTopicRule.LambdaActionProperty( function_arn="functionArn" ), location=iot.CfnTopicRule.LocationActionProperty( device_id="deviceId", latitude="latitude", longitude="longitude", role_arn="roleArn", tracker_name="trackerName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" ) ), open_search=iot.CfnTopicRule.OpenSearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), republish=iot.CfnTopicRule.RepublishActionProperty( role_arn="roleArn", topic="topic", # the properties below are optional headers=iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] ), qos=123 ), s3=iot.CfnTopicRule.S3ActionProperty( bucket_name="bucketName", key="key", role_arn="roleArn", # the properties below are optional canned_acl="cannedAcl" ), sns=iot.CfnTopicRule.SnsActionProperty( role_arn="roleArn", target_arn="targetArn", # the properties below are optional message_format="messageFormat" ), sqs=iot.CfnTopicRule.SqsActionProperty( queue_url="queueUrl", role_arn="roleArn", # the properties below are optional use_base64=False ), step_functions=iot.CfnTopicRule.StepFunctionsActionProperty( role_arn="roleArn", state_machine_name="stateMachineName", # the properties below are optional execution_name_prefix="executionNamePrefix" ), timestream=iot.CfnTopicRule.TimestreamActionProperty( database_name="databaseName", dimensions=[iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )], role_arn="roleArn", table_name="tableName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" ) ) )], sql="sql", # the properties below are optional aws_iot_sql_version="awsIotSqlVersion", description="description", error_action=iot.CfnTopicRule.ActionProperty( cloudwatch_alarm=iot.CfnTopicRule.CloudwatchAlarmActionProperty( alarm_name="alarmName", role_arn="roleArn", state_reason="stateReason", state_value="stateValue" ), cloudwatch_logs=iot.CfnTopicRule.CloudwatchLogsActionProperty( log_group_name="logGroupName", role_arn="roleArn", # the properties below are optional batch_mode=False ), cloudwatch_metric=iot.CfnTopicRule.CloudwatchMetricActionProperty( metric_name="metricName", metric_namespace="metricNamespace", metric_unit="metricUnit", metric_value="metricValue", role_arn="roleArn", # the properties below are optional metric_timestamp="metricTimestamp" ), dynamo_db=iot.CfnTopicRule.DynamoDBActionProperty( hash_key_field="hashKeyField", hash_key_value="hashKeyValue", role_arn="roleArn", table_name="tableName", # the properties below are optional hash_key_type="hashKeyType", payload_field="payloadField", range_key_field="rangeKeyField", range_key_type="rangeKeyType", range_key_value="rangeKeyValue" ), dynamo_dBv2=iot.CfnTopicRule.DynamoDBv2ActionProperty( put_item=iot.CfnTopicRule.PutItemInputProperty( table_name="tableName" ), role_arn="roleArn" ), elasticsearch=iot.CfnTopicRule.ElasticsearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), firehose=iot.CfnTopicRule.FirehoseActionProperty( delivery_stream_name="deliveryStreamName", role_arn="roleArn", # the properties below are optional batch_mode=False, separator="separator" ), http=iot.CfnTopicRule.HttpActionProperty( url="url", # the properties below are optional auth=iot.CfnTopicRule.HttpAuthorizationProperty( sigv4=iot.CfnTopicRule.SigV4AuthorizationProperty( role_arn="roleArn", service_name="serviceName", signing_region="signingRegion" ) ), confirmation_url="confirmationUrl", headers=[iot.CfnTopicRule.HttpActionHeaderProperty( key="key", value="value" )] ), iot_analytics=iot.CfnTopicRule.IotAnalyticsActionProperty( channel_name="channelName", role_arn="roleArn", # the properties below are optional batch_mode=False ), iot_events=iot.CfnTopicRule.IotEventsActionProperty( input_name="inputName", role_arn="roleArn", # the properties below are optional batch_mode=False, message_id="messageId" ), iot_site_wise=iot.CfnTopicRule.IotSiteWiseActionProperty( put_asset_property_value_entries=[iot.CfnTopicRule.PutAssetPropertyValueEntryProperty( property_values=[iot.CfnTopicRule.AssetPropertyValueProperty( timestamp=iot.CfnTopicRule.AssetPropertyTimestampProperty( time_in_seconds="timeInSeconds", # the properties below are optional offset_in_nanos="offsetInNanos" ), value=iot.CfnTopicRule.AssetPropertyVariantProperty( boolean_value="booleanValue", double_value="doubleValue", integer_value="integerValue", string_value="stringValue" ), # the properties below are optional quality="quality" )], # the properties below are optional asset_id="assetId", entry_id="entryId", property_alias="propertyAlias", property_id="propertyId" )], role_arn="roleArn" ), kafka=iot.CfnTopicRule.KafkaActionProperty( client_properties={ "client_properties_key": "clientProperties" }, destination_arn="destinationArn", topic="topic", # the properties below are optional headers=[iot.CfnTopicRule.KafkaActionHeaderProperty( key="key", value="value" )], key="key", partition="partition" ), kinesis=iot.CfnTopicRule.KinesisActionProperty( role_arn="roleArn", stream_name="streamName", # the properties below are optional partition_key="partitionKey" ), lambda_=iot.CfnTopicRule.LambdaActionProperty( function_arn="functionArn" ), location=iot.CfnTopicRule.LocationActionProperty( device_id="deviceId", latitude="latitude", longitude="longitude", role_arn="roleArn", tracker_name="trackerName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestampProperty( value="value", # the properties below are optional unit="unit" ) ), open_search=iot.CfnTopicRule.OpenSearchActionProperty( endpoint="endpoint", id="id", index="index", role_arn="roleArn", type="type" ), republish=iot.CfnTopicRule.RepublishActionProperty( role_arn="roleArn", topic="topic", # the properties below are optional headers=iot.CfnTopicRule.RepublishActionHeadersProperty( content_type="contentType", correlation_data="correlationData", message_expiry="messageExpiry", payload_format_indicator="payloadFormatIndicator", response_topic="responseTopic", user_properties=[iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )] ), qos=123 ), s3=iot.CfnTopicRule.S3ActionProperty( bucket_name="bucketName", key="key", role_arn="roleArn", # the properties below are optional canned_acl="cannedAcl" ), sns=iot.CfnTopicRule.SnsActionProperty( role_arn="roleArn", target_arn="targetArn", # the properties below are optional message_format="messageFormat" ), sqs=iot.CfnTopicRule.SqsActionProperty( queue_url="queueUrl", role_arn="roleArn", # the properties below are optional use_base64=False ), step_functions=iot.CfnTopicRule.StepFunctionsActionProperty( role_arn="roleArn", state_machine_name="stateMachineName", # the properties below are optional execution_name_prefix="executionNamePrefix" ), timestream=iot.CfnTopicRule.TimestreamActionProperty( database_name="databaseName", dimensions=[iot.CfnTopicRule.TimestreamDimensionProperty( name="name", value="value" )], role_arn="roleArn", table_name="tableName", # the properties below are optional timestamp=iot.CfnTopicRule.TimestreamTimestampProperty( unit="unit", value="value" ) ) ), rule_disabled=False )
Attributes
- actions
The actions associated with the rule.
- aws_iot_sql_version
The version of the SQL rules engine to use when evaluating the rule.
The default value is 2015-10-08.
- description
The description of the rule.
- error_action
The action to take when an error occurs.
- rule_disabled
Specifies whether the rule is disabled.
- sql
The SQL statement used to query the topic.
For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide .
UserPropertyProperty
- class CfnTopicRule.UserPropertyProperty(*, key, value)
Bases:
object
A key-value pair that you define in the header.
- Parameters:
key (
str
) – A key to be specified inUserProperty
.value (
str
) – A value to be specified inUserProperty
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_iot as iot user_property_property = iot.CfnTopicRule.UserPropertyProperty( key="key", value="value" )
Attributes
- key
A key to be specified in
UserProperty
.
- value
A value to be specified in
UserProperty
.