Giter Site home page Giter Site logo

aws-cdk-sample-lambda-layers's Introduction

AWS CDK Sample Lambda Layers Project

This project creates two stacks. One stack creates a LambdaLayerVersion that hold the NPM dependency chalk. The other stack creates a new LambdaFunction that uses the layer's chalk dependency to print "Hello World!".

Notice: There are known CloudFormation limitations when using Lambda layers across multiple stacks. To workaround this problem, we create the Lambda layer stack first and store the created Lambda Layer's ARN in SSM parameter store. We then deploy the Lambda function stack which imports that Layer ARN from SSM parameter store. This allows users to update the configuration of the Lambda Layer without running into the dependency error:

Error: someResource cannot be updated as it is in use by otherResource

For other workarounds checkout this issue thread.

๐Ÿš€ Quick Start

1. Install dependencies with Yarn v1

  yarn install

2. Create the bootstrap stack in your AWS account This only needs to be ran once per account/region.

  yarn bootstrap

3. Build Cloudformation files

  yarn build

4. Deploy the Lambda Layer stack

  yarn deploy LambdaLayerStack

5. Deploy the Lambda Function stack

  yarn deploy LambdaFunctionStack

aws-cdk-sample-lambda-layers's People

Contributors

ryparker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.