awssolutionsconstructsawsiotsqs

package module
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

aws-iot-sqs module


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.

Documentation

Overview

CDK Constructs for AWS IoT to AWS SQS integration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IotToSqs_IsConstruct

func IotToSqs_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func NewIotToSqs_Override

func NewIotToSqs_Override(i IotToSqs, scope constructs.Construct, id *string, props *IotToSqsProps)

Types

type IotToSqs

type IotToSqs interface {
	constructs.Construct
	DeadLetterQueue() *awssqs.DeadLetterQueue
	EncryptionKey() awskms.IKey
	IotActionsRole() awsiam.Role
	IotTopicRule() awsiot.CfnTopicRule
	Node() constructs.Node
	SqsQueue() awssqs.Queue
	ToString() *string
}

func NewIotToSqs

func NewIotToSqs(scope constructs.Construct, id *string, props *IotToSqsProps) IotToSqs

type IotToSqsProps

type IotToSqsProps struct {
	// User provided CfnTopicRuleProps to override the defaults.
	IotTopicRuleProps *awsiot.CfnTopicRuleProps `json:"iotTopicRuleProps"`
	// Optional user provided properties for the dead letter queue.
	DeadLetterQueueProps *awssqs.QueueProps `json:"deadLetterQueueProps"`
	// Whether to deploy a secondary queue to be used as a dead letter queue.
	DeployDeadLetterQueue *bool `json:"deployDeadLetterQueue"`
	// 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.
	EnableEncryptionWithCustomerManagedKey *bool `json:"enableEncryptionWithCustomerManagedKey"`
	// An optional, imported encryption key to encrypt the SQS queue, and SNS Topic.
	EncryptionKey awskms.Key `json:"encryptionKey"`
	// Optional user-provided props to override the default props for the encryption key.
	EncryptionKeyProps *awskms.KeyProps `json:"encryptionKeyProps"`
	// Existing instance of SQS queue object, providing both this and queueProps will cause an error.
	ExistingQueueObj awssqs.Queue `json:"existingQueueObj"`
	// The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
	MaxReceiveCount *float64 `json:"maxReceiveCount"`
	// User provided props to override the default props for the SQS queue.
	QueueProps *awssqs.QueueProps `json:"queueProps"`
}

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL