aws-lambda-sqs-lambda
Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
Language | Package |
---|---|
|
|
|
|
|
|
Overview
This AWS Solutions Construct implements (1) an AWS Lambda function that is configured to send messages to a queue; (2) an Amazon SQS queue; and (3) an AWS Lambda function configured to consume messages from the queue.
Here is a minimal deployable pattern definition:
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingProducerLambdaObj? |
An optional, existing Lambda function to be used instead of the default
function for sending messages to the queue. Providing both this and
|
|
producerLambdaFunctionProps? |
Optional user-provided properties to override the default properties for the producer Lambda function. |
|
existingQueueObj? |
An optional, existing SQS queue to be used instead of the default
queue. Providing both this and |
|
queueProps? |
Optional user-provided properties to override the default properties
for the SQS queue. Providing both this and |
|
deployDeadLetterQueue? |
|
Whether to create a secondary queue
to be used as a dead letter queue. Defaults to |
deadLetterQueueProps? |
Optional user-provided props to override the default props for the dead
letter queue. Only used if the |
|
maxReceiveCount? |
|
The number of times a message can be
unsuccessfully dequeued before being moved to the dead letter queue.
Defaults to |
existingConsumerLambdaObj? |
An optional, existing Lambda function to be used instead of the default
function for receiving/consuming messages from the queue. Providing both
this and |
|
consumerLambdaFunctionProps? |
Optional user-provided properties to override the default properties for the consumer Lambda function. |
|
queueEnvironmentVariableName? |
|
Optional Name for the Lambda function environment variable set to the URL of the queue. Default: SQS_QUEUE_URL |
sqsEventSourceProps? |
Optional user provided properties for the queue event source. |
|
existingVpc? |
An optional, existing VPC into which this pattern should be deployed.
When deployed in a VPC, the Lambda function will use ENIs in the VPC to
access network resources and an Interface Endpoint will be created in
the VPC for Amazon SQS. If an existing VPC is provided, the |
|
vpcProps? |
Optional user-provided properties to override the default properties
for the new VPC. |
|
deployVpc? |
|
Whether to create a new VPC based on |
Pattern Properties
Name | Type | Description |
---|---|---|
producerLambdaFunction |
Returns an instance of the producer Lambda function created by the pattern. |
|
sqsQueue |
Returns an instance of the SQS queue created by the pattern. |
|
deadLetterQueue? |
Returns an instance of the dead letter queue created by the pattern, if one is deployed. |
|
consumerLambdaFunction |
Returns an instance of the consumer Lambda function created by the pattern. |
|
vpc? |
Returns an interface on the VPC used by the pattern (if any). This may be a VPC created by the pattern or the VPC supplied to the pattern constructor. |
Default Settings
Out-of-the-box implementation of this Construct (without any overridden properties) will adhere to the following defaults:
AWS Lambda Functions
-
Configure limited privilege access IAM role for Lambda functions.
-
Enable reusing connections with Keep-Alive for NodeJs Lambda functions.
-
Enable X-Ray Tracing
-
Set Environment Variables
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
-
Amazon SQS Queue
-
Deploy a dead letter queue for the primary queue.
-
Enable server-side encryption for the primary queue using an AWS Managed KMS Key.
-
Enforce encryption of data in transit
Architecture

Github
Go to the Github repo