Skip to main content

CDK Constructs for AWS IoT to AWS SQS integration

Project description

aws-iot-sqs module

---

Stability: Experimental

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
Python Logo Python aws_solutions_constructs.aws_iot_sqs
Typescript Logo Typescript @aws-solutions-constructs/aws-iot-sqs
Java Logo Java 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);

Initializer

new IotToSqs(scope: Construct, id: string, props: IotToSqsProps);

Parameters

Pattern Construct Props

Name Type Description
iotTopicRuleProps iot.CfnTopicRuleProps User provided CfnTopicRuleProps to override the defaults
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.

Pattern Properties

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

Default settings

Out of the box implementation of the Construct without any override will set the following defaults:

Amazon IoT Rule

  • Configure an IoT Rule to send messages to the SQS Queue

Amazon IAM Role

  • Configure least privilege access IAM role for Amazon IoT to be able to publish messages to the SQS Queue

Amazon 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.

Architecture

Architecture Diagram


© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws-solutions-constructs.aws-iot-sqs-2.3.0.tar.gz (314.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file aws-solutions-constructs.aws-iot-sqs-2.3.0.tar.gz.

File metadata

  • Download URL: aws-solutions-constructs.aws-iot-sqs-2.3.0.tar.gz
  • Upload date:
  • Size: 314.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.5

File hashes

Hashes for aws-solutions-constructs.aws-iot-sqs-2.3.0.tar.gz
Algorithm Hash digest
SHA256 f54b5474d7525fe54dffb7e497ae267cc8718f8b8991fe24da7f7c5a4ccbf341
MD5 e203a193eac787b4b1c188047dc22b94
BLAKE2b-256 963d4eff8dd3848bcab696416e9b728b957e6add7f865bb292c6a4d238754040

See more details on using hashes here.

File details

Details for the file aws_solutions_constructs.aws_iot_sqs-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: aws_solutions_constructs.aws_iot_sqs-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 313.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.5

File hashes

Hashes for aws_solutions_constructs.aws_iot_sqs-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67f04fd3e36e4a0abe3a65806d1e46179f3c02d8fd3f5eb7fbcb3be9248e4c26
MD5 2d02604d2e11547bc4ad62eef5ca6dc3
BLAKE2b-256 a45621b6eab9015e699842aa3aef59b9bd9c0990a75483c4e2db94e26042b4ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page