auto-cdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

Auto CDK

auto-cdk lets you generate an api gateway with lambda integrations based on the filesystem. It makes use of AWS CDK to generate cloudformation stacks, and Webpack for bundling and code-splitting.

Caveats

Currently this project only aims to build and package node/typescript-based integrations. It is on the roadmap to support more, but will not be available until a later version.

Quickstart

yarn add auto-cdk

Create an api directory and add a file to it that exports a function named handler:

$ mkdir api && touch api/index.ts
// api/index.ts
 
exports.handler = (event, ctx) => {
  return {
    statusCode: 200,
    body: 'hello world',
    headers: {
      'Content-Type': 'text/html'
    }
  }
}

Run:

$ yarn dev

You should now have webpack auto-compiling when your source changes, and a cdk stack that has been generated in cdk.out.

Bonus

If you install AWS sam-cli, you can run the api on localhost with the following:

$ sam local start-api cdk.out/*.template.json

View more examples here.

Features

  • Automatic CDK Stack Generation
  • Code-Splitting and Bundling with Webpack
  • Out of the box typescript support

Contributing

If you would like to make a contribution or learn more about running this project locally, please review the Contributing Documentation.

Readme

Keywords

none

Package Sidebar

Install

npm i auto-cdk

Weekly Downloads

11

Version

0.1.6

License

MIT

Unpacked Size

87.5 kB

Total Files

48

Last publish

Collaborators

  • wulfmann