aws-lambda-sqs
Reference Documentation: | https://docs.aws.amazon.com/solutions/latest/constructs/ |
Language | Package |
---|---|
|
|
|
|
|
|
Overview
This AWS Solutions Construct implements an AWS Lambda function connected to an Amazon SQS queue.
Here is a minimal deployable pattern definition:
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? |
An optional, existing Lambda function to be used instead of the default
function. Providing both this and |
|
lambdaFunctionProps? |
Optional user-provided properties to override the default properties for the 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. |
|
enableQueuePurging? |
|
Whether to grant additional permissions
to the Lambda function enabling it to purge the SQS queue. Defaults to
|
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 |
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 |
queueEnvironmentVariableName? |
|
Optional Name for the Lambda function environment variable set to the URL of the queue. Default: SQS_QUEUE_URL |
enableEncryptionWithCustomerManagedKey? |
|
If no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. This flag is ignored if any of the following are defined: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps. |
encryptionKey? |
An optional, imported encryption key to encrypt the SQS Queue with. |
|
encryptionKeyProps? |
Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with. |
Pattern Properties
Name | Type | Description |
---|---|---|
lambdaFunction |
Returns an instance of the 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. |
|
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 the Construct without any override will set the following defaults:
AWS Lambda Function
-
Configure limited privilege access IAM role for Lambda function.
-
Enable reusing connections with Keep-Alive for NodeJs Lambda function.
-
Allow the function to send messages only to the queue (purging can be enabled using the
enableQueuePurge
property). -
Enable X-Ray Tracing
-
Set Environment Variables
-
SQS_QUEUE_URL
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
-
Amazon SQS Queue
-
Deploy SQS dead-letter queue for the source SQS Queue.
-
Enable server-side encryption for source SQS Queue using AWS Managed KMS Key.
-
Enforce encryption of data in transit
Architecture

Github
Go to the Github repo