Coder Social home page Coder Social logo

fogfish / aws-cdk-pure Goto Github PK

View Code? Open in Web Editor NEW
93.0 4.0 6.0 1.25 MB

Purely Functional and high-order cloud components with AWS CDK

License: MIT License

TypeScript 96.49% Makefile 1.01% JavaScript 2.50%
aws-cdk aws higher-order-component hoc cloud-component infrastructure pure-functional typescript iaac infrastructure-as-code

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  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.