CDK Constructs for AWS SNS to AWS Lambda integration
Project description
aws-sns-lambda 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 | aws_solutions_constructs.aws_sns_lambda |
Typescript | @aws-solutions-constructs/aws-sns-lambda |
Java | software.amazon.awsconstructs.services.snslambda |
This AWS Solutions Construct implements an Amazon SNS connected to an AWS Lambda function.
Here is a minimal deployable pattern definition:
const { SnsToLambdaProps, SnsToLambda } = require('@aws-solutions-constructs/aws-sns-lambda');
const stack = new Stack(app, 'test-sns-lambda');
// Definitions
const props: SnsToLambdaProps = {
lambdaFunctionProps: {
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
code: lambda.Code.asset(`${__dirname}/lambda`)
}
};
new SnsToLambda(stack, 'test-sns-lambda', props);
Initializer
new SnsToLambda(scope: Construct, id: string, props: SnsToLambdaProps);
Parameters
- scope
Construct
- id
string
- props
S3ToLambdaProps
Pattern Construct Props
Name | Type | Description |
---|---|---|
existingLambdaObj? | lambda.Function |
Existing instance of Lambda Function object, if this is set then the lambdaFunctionProps is ignored. |
lambdaFunctionProps? | lambda.FunctionProps |
User provided props to override the default props for the Lambda function. |
topicProps? | sns.TopicProps |
Optional user provided properties to override the default properties for the SNS topic. |
enableEncryption? | 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 SNS topic with. |
Pattern Properties
Name | Type | Description |
---|---|---|
lambdaFunction | lambda.Function |
Returns an instance of the Lambda function created by the pattern. |
snsTopic | sns.Topic |
Returns an instance of the SNS topic created by the pattern. |
encryptionKey | kms.Key |
Returns an instance of kms.Key used for the SNS topic. |
Default settings
Out of the box implementation of the Construct without any override will set the following defaults:
Amazon SNS Topic
- Configure least privilege access permissions for SNS Topic
- Enable server-side encryption forSNS Topic using Customer managed KMS Key
- Enforce encryption of data in transit
AWS Lambda Function
- Configure least privilege access IAM role for Lambda function
- Enable reusing connections with Keep-Alive for NodeJs Lambda function
Architecture
© Copyright 2020 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
Built Distribution
Hashes for aws-solutions-constructs.aws-sns-lambda-1.58.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e13d7efccfa2d68231ba0dd433876269caeeec3fbd5c07dc20c2def14c6eec9f |
|
MD5 | 451695c1ba0835ac9105720a464f21ad |
|
BLAKE2b-256 | c3bdd7c0ccc9de4fe4fb1081f5e2afc8adcad5202735909361b4dcf100bacb52 |
Hashes for aws_solutions_constructs.aws_sns_lambda-1.58.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f7ac83c49e09e74163654b08b26aed202b5fd472ce1361bd5e5872c5c49aa89 |
|
MD5 | c48c7f887ce7512aea15913aa9f2afe7 |
|
BLAKE2b-256 | 15b35725fce730c8465f2ff745ba8ec0641b7b70c5da5a6d39c6cad4913300cf |