Categorygithub.com/christian-korneck/awssc-go-dist/awssolutionsconstructsawssnslambda/v2

# Packages

No description provided by the author

# README

aws-sns-lambda module


Stability: Stable


Reference Documentation:https://docs.aws.amazon.com/solutions/latest/constructs/
LanguagePackage
Python Logo Pythonaws_solutions_constructs.aws_sns_lambda
Typescript Logo Typescript@aws-solutions-constructs/aws-sns-lambda
Java Logo Javasoftware.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 in Typescript:

import { SnsToLambda, SnsToLambdaProps } from "@aws-solutions-constructs/aws-sns-lambda";

new SnsToLambda(this, 'test-sns-lambda', {
    lambdaFunctionProps: {
        runtime: lambda.Runtime.NODEJS_14_X,
        handler: 'index.handler',
        code: lambda.Code.fromAsset(`${__dirname}/lambda`)
    }
});

Initializer

new SnsToLambda(scope: Construct, id: string, props: SnsToLambdaProps);

Parameters

Pattern Construct Props

NameTypeDescription
existingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error.
lambdaFunctionProps?lambda.FunctionPropsUser provided props to override the default props for the Lambda function.
existingTopicObj?sns.TopicExisting instance of SNS Topic object, providing both this and topicProps will cause an error.
topicProps?sns.TopicPropsOptional user provided properties to override the default properties for the SNS topic.

Pattern Properties

NameTypeDescription
lambdaFunctionlambda.FunctionReturns an instance of the Lambda function created by the pattern.
snsTopicsns.TopicReturns an instance of the SNS topic created by the pattern.

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 for SNS Topic using AWS managed KMS Key
  • Enforce encryption of data in transit

AWS Lambda Function

  • Configure limited privilege access IAM role for Lambda function
  • Enable reusing connections with Keep-Alive for NodeJs Lambda function
  • Enable X-Ray Tracing
  • Set Environment Variables
    • AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)

Architecture

Architecture Diagram


© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.