All classes are under active development and subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
---|
Language | Package |
---|---|
aws_solutions_constructs.aws_iot_sqs |
|
@aws-solutions-constructs/aws-iot-sqs |
|
software.amazon.awsconstructs.services.iotsqs |
This AWS Solutions Construct implements an AWS IoT MQTT topic rule and an AWS SQS Queue pattern.
Here is a minimal deployable pattern definition in Typescript:
const { IotToSqsProps, IotToSqs } from '@aws-solutions-constructs/aws-iot-sqs';
const props: IotToSqsProps = {
iotTopicRuleProps: {
topicRulePayload: {
ruleDisabled: false,
description: "Testing the IotToSqs Pattern",
sql: "SELECT * FROM 'iot/sqs/#'",
actions: []
}
}
};
new IotToSqs(this, 'test-iot-sqs-integration', props);
new IotToSqs(scope: Construct, id: string, props: IotToSqsProps);
Parameters
- scope
Construct
- id
string
- props
IotToSqsProps
Name | Type | Description |
---|---|---|
existingQueueObj? | sqs.Queue |
Existing instance of SQS queue object, providing both this and queueProps will cause an error. |
queueProps? | sqs.QueueProps |
User provided props to override the default props for the SQS queue. |
deadLetterQueueProps? | sqs.QueueProps |
Optional user provided properties for the dead letter queue. |
deployDeadLetterQueue? | boolean |
Whether to deploy a secondary queue to be used as a dead letter queue. Default true . |
maxReceiveCount? | number |
The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. Required field if deployDeadLetterQueue =true . |
enableEncryptionWithCustomerManagedKey? | boolean |
Use a KMS Key, either managed by this CDK app, or imported. If importing an encryption key, it must be specified in the encryptionKey property for this construct. |
encryptionKey? | kms.Key |
An optional, imported encryption key to encrypt the SQS queue. |
encryptionKeyProps? | kms.KeyProps |
Optional user-provided props to override the default props for the encryption key. |
iotTopicRuleProps? | iot.CfnTopicRuleProps |
User provided CfnTopicRuleProps to override the defaults |
Name | Type | Description |
---|---|---|
encryptionKey? | kms.Key |
Returns an instance of kms.Key used for the SQS queue. |
iotActionsRole | iam.Role |
Returns an instance of iam.Role created by the construct, which allows IoT to publish messages to the SQS Queue |
sqsQueue | sqs.Queue |
Returns an instance of sqs.Queue created by the construct |
deadLetterQueue? | sqs.Queue |
Returns an instance of the dead-letter SQS queue created by the pattern. |
iotTopicRule | iot.CfnTopicRule |
Returns an instance of iot.CfnTopicRule created by the construct |
Out of the box implementation of the Construct without any override will set the following defaults:
- Configure an IoT Rule to send messages to the SQS Queue
- Configure least privilege access IAM role for Amazon IoT to be able to publish messages to the SQS Queue
- Deploy a dead-letter queue for the source queue.
- Enable server-side encryption for the source queue using a customer-managed AWS KMS key.
- Enforce encryption of data in transit.
© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.