Git Product home page Git Product logo

aws-cdk-pure's Introduction

aws-cdk-pure

The library is a toolkit for development of high-order and purely functional components with AWS CDK.

Build Status Git Hub npm npm

Inspiration

The purely functional extension to AWS CDK and has been inspired by the following posts

aws-cdk-pure is an utility for design and development of purely functional and higher-order components. You know React Hooks! Think of it as hooks for your cloud infrastructure.

Getting Started

This repository implements TypeScript libraries for cloud development. Please see its details and guidelines in corresponding README.md files

  • aws-cdk-pure - a core part of the toolkit. It defines types and functional primitives required for hight-order components development. It maintain a slim dependencies towards other library, only @aws-cdk/core is used.

  • aws-cdk-pure-hoc - implements reusable purely functional high-order components. These components are building blocks and design patterns for your cloud infrastructure.

How To Contribute

The library is MIT licensed and accepts contributions via GitHub pull requests:

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

The development requires TypeScript and AWS CDK

npm install -g typescript ts-node aws-cdk
git clone https://github.com/fogfish/aws-cdk-pure
cd aws-cdk-pure

## cd either to pure or hoc folder

npm install
npm run test
npm run lint
npm run build

License

See LICENSE

aws-cdk-pure's People

Contributors

dependabot[bot] avatar fogfish 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  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  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  avatar

Watchers

 avatar  avatar  avatar  avatar

aws-cdk-pure's Issues

Throw if name is empty

Leaving the name empty is a frequent source of bugs and errors, since I use lambda functions, and forget to add the name field. e.g.

pure.join(scope, cloud.stack(() => ({}))) 

Would it be possible to create an invariant to check the name field? And even better would be if I can skip the empty lambda altogether:

pure.join(scope, cloud.stack('MyStack')) 

It would remove a lot of boilerplate.

New stack combinator

As a developer
I want to give a name and pass parameters to cdk.Stack
So that single application delivers immutable green/blue variants of same stack

With current API, you do

const app = new cdk.App()
const stack = new cdk.Stack(app, `xxx-${vsn}`, {
  env: {
    account: process.env.CDK_DEFAULT_ACCOUNT,
    region: process.env.CDK_DEFAULT_REGION
  }
})
pure.join(stack, MyComponent)
app.synth()

I'd like to make it

const Stack = (): cdk.StackProps => ({ env: {} })
const stack = pure.iaac(cdk.Stack)(Stack).effect(x => pure.join(x, MyComponent))
const app = new cdk.App()
pure.join(app, stack)

add `join` operator to `IPure<T>`

The lib supports stack construction using following syntax

const app = new cdk.App()
const stack = (): cdk.StackProps => ({})
pure.iaac(cdk.Stack)(stack)
  .effect(x => {
    pure.join(x, RestApi)
    pure.join(x, LogGroup)
    pure.join(x, CodeBuildEvents)
  })
app.synth()

The code become cleaner if join is part of IPure

pure.iaac(cdk.Stack)(stack)
  .join(RestApi)
  .join(LogGroup)
  .join(CodeBuildEvents)

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.