1.69.0 • Published 4 years ago

@ddweerasiri/aws-lambda-sns v1.69.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

aws-lambda-sns module


Stability: Experimental

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/
LanguagePackage
Python Logo Pythonaws_solutions_constructs.aws_lambda_sns
Typescript Logo Typescript@aws-solutions-constructs/aws-lambda-sns
Java Logo Javasoftware.amazon.awsconstructs.services.lambdasns

This AWS Solutions Construct implements an AWS Lambda function connected to an Amazon SNS topic.

Here is a minimal deployable pattern definition in Typescript:

import { LambdaToSns, LambdaToSnsProps } from "@aws-solutions-constructs/aws-lambda-sns";

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

Initializer

new LambdaToSns(scope: Construct, id: string, props: LambdaToSnsProps);

Parameters

Pattern Construct Props

NameTypeDescription
existingLambdaObj?lambda.FunctionExisting instance of Lambda Function object, if this is set then the lambdaFunctionProps is ignored.
lambdaFunctionProps?lambda.FunctionPropsUser provided props to override the default props for the Lambda function.
existingTopicObj?sns.TopicExisting instance of SNS Topic object, if this is set then the topicProps is ignored.
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:

AWS Lambda Function

  • Configure least privilege access IAM role for Lambda function
  • Enable reusing connections with Keep-Alive for NodeJs Lambda function
  • Enable X-Ray Tracing

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

Architecture Diagram


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