aws-lambda-sns
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 SNS topic.
Here is a minimal deployable pattern definition:
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? |
Existing instance of Lambda Function object, providing both this and
|
|
lambdaFunctionProps? |
User provided props to override the default props for the Lambda function. |
|
existingTopicObj? |
Existing instance of SNS Topic object, providing both this and
|
|
topicProps? |
Optional user provided properties to override the default properties for the SNS topic. |
|
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 SNS. 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 |
topicArnEnvironmentVariableName? |
|
Optional Name for the Lambda function environment variable set to the arn of the topic. Default: SNS_TOPIC_ARN |
topicNameEnvironmentVariableName? |
|
Optional Name for the Lambda function environment variable set to the name of the topic. Default: SNS_TOPIC_NAME |
enableEncryptionWithCustomerManagedKey? |
|
If no key is provided, this flag determines whether the SNS Topic is encrypted with a new CMK or an AWS managed key. This flag is ignored if any of the following are defined: topicProps.masterKey, encryptionKey or encryptionKeyProps. |
encryptionKey? |
An optional, imported encryption key to encrypt the SNS Topic with. |
|
encryptionKeyProps? |
Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SNS Topic with. |
Pattern Properties
Name | Type | Description |
---|---|---|
lambdaFunction |
Returns an instance of the Lambda function created by the pattern. |
|
snsTopic |
Returns an instance of the SNS topic 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 the Construct without any override will set the following defaults:
AWS Lambda Function
-
Configure limited privilege access IAM role for Lambda function to access the Firehose Delivery Stream
-
Enable reusing connections with Keep-Alive for NodeJs Lambda function
-
Enable X-Ray Tracing
-
Set Environment Variables
-
(default) SNS_TOPIC_NAME
-
(default) SNS_TOPIC_ARN
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
-
Amazon SNS Topic
-
Configure least privilege access permissions for SNS Topic
-
Enable server-side encryption forSNS Topic using AWS managed KMS Key
-
Enforce encryption of data in transit
Architecture

Github
Go to the Github repo