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:

# Example automatically generated from non-compiling source. May contain errors.
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
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

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-1.131.0.tar.gz (311.6 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-1.131.0.tar.gz.

File metadata

  • Download URL: aws-solutions-constructs.aws-iot-sqs-1.131.0.tar.gz
  • Upload date:
  • Size: 311.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.5

File hashes

Hashes for aws-solutions-constructs.aws-iot-sqs-1.131.0.tar.gz
Algorithm Hash digest
SHA256 ebbaaa18ec94ca4a7927a7b0d0f885ac6288e13f0559e133add3775d34e08f13
MD5 a4f96f4b57f953171b757399c7f77001
BLAKE2b-256 1e6fc96480476d28cc085ed59157ef01bc447543dedc8031b37283339e22837f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aws_solutions_constructs.aws_iot_sqs-1.131.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcfd00bb70b774ba35e4a8b0c39a5aad4db20365c213f5e2f72fdaa1d11acf7e
MD5 7dee11c4cab8ec211f6d538f3a71f586
BLAKE2b-256 1b8d578b31eac67d4052ccfe9535d72898a082727c18250858144f7d6f983697

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