Code Monkey home page Code Monkey logo

cdk-typescript-lambda's Introduction

Write TypeScript Lambda functions in AWS CDK - Complete Guide

A repository for an article on bobbyhadz.com

If you use CDK version 1, switch to the cdk-v1 branch.

How to Use

  1. Clone the repository

  2. Install the dependencies

npm install
  1. Create the CDK stack
npx aws-cdk deploy
  1. Open the AWS Console and the stack should be created in your default region

  2. Cleanup

npx aws-cdk destroy

cdk-typescript-lambda's People

Contributors

bobbyhadz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cdk-typescript-lambda's Issues

Question about this example: does it need docker?

I followed this example but it doesn't want to synth; does this need linux, specifically, to work? And does it also need docker?

c:\work\ba\>cdk synth
Error: spawnSync docker ENOENT
    at Object.spawnSync (node:internal/child_process:1119:20)
    at Object.spawnSync (node:child_process:847:24)
    at dockerExec (c:\work\ba\\node_modules\aws-cdk-lib\core\lib\bundling.js:1:4869)
    at Function.fromBuild (c:\work\ba\\node_modules\aws-cdk-lib\core\lib\bundling.js:1:3494)
    at new Bundling (c:\work\ba\\node_modules\aws-cdk-lib\aws-lambda-nodejs\lib\bundling.js:1:1897)
    at Function.bundle (c:\work\ba\\node_modules\aws-cdk-lib\aws-lambda-nodejs\lib\bundling.js:1:2733)
    at new NodejsFunction (c:\work\ba\\node_modules\aws-cdk-lib\aws-lambda-nodejs\lib\function.js:1:1229)
    at new BraunAwsStack (c:\work\ba\\lib\braun-aws-stack.ts:19:23)
    at Object.<anonymous> (c:\work\ba\\bin\braun-aws.ts:7:1)
    at Module._compile (node:internal/modules/cjs/loader:1155:14) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawnSync docker',
  path: 'docker',
  spawnargs: [
    'build',
    '-t',
    'cdk-d427175df07767a5bcd3efd0820a9071eb9f0dc1eda703d5a6927e5f9f8663f4',
    '--platform',
    'linux/amd64',
    '--build-arg',
    'IMAGE=public.ecr.aws/sam/build-nodejs16.x',
    '--build-arg',
    'ESBUILD_VERSION=0',
    'c:\\work\\ba\\\\node_modules\\aws-cdk-lib\\aws-lambda-nodejs\\lib'
  ]
}

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.