awssolutionsconstructsawssnslambda

package module
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

aws-sns-lambda module



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

Name Type Description
existingLambdaObj? lambda.Function Existing instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error.
lambdaFunctionProps? lambda.FunctionProps User provided props to override the default props for the Lambda function.
existingTopicObj? sns.Topic Existing instance of SNS Topic object, providing both this and topicProps will cause an error.
topicProps? sns.TopicProps Optional user provided properties to override the default properties for the SNS topic.

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.

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.

Documentation

Overview

CDK Constructs for AWS SNS to AWS Lambda integration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSnsToLambda_Override

func NewSnsToLambda_Override(s SnsToLambda, scope constructs.Construct, id *string, props *SnsToLambdaProps)

func SnsToLambda_IsConstruct

func SnsToLambda_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

Types

type SnsToLambda

type SnsToLambda interface {
	constructs.Construct
	LambdaFunction() awslambda.Function
	Node() constructs.Node
	SnsTopic() awssns.Topic
	ToString() *string
}

func NewSnsToLambda

func NewSnsToLambda(scope constructs.Construct, id *string, props *SnsToLambdaProps) SnsToLambda

type SnsToLambdaProps

type SnsToLambdaProps struct {
	// Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.
	ExistingLambdaObj awslambda.Function `json:"existingLambdaObj"`
	// Existing instance of SNS Topic object, providing both this and topicProps will cause an error..
	ExistingTopicObj awssns.Topic `json:"existingTopicObj"`
	// User provided props to override the default props for the Lambda function.
	LambdaFunctionProps *awslambda.FunctionProps `json:"lambdaFunctionProps"`
	// Optional user provided properties to override the default properties for the SNS topic.
	TopicProps *awssns.TopicProps `json:"topicProps"`
}

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL