fogfish / aws-cdk-pure Goto Github PK
View Code? Open in Web Editor NEWPurely Functional and high-order cloud components with AWS CDK
License: MIT License
Purely Functional and high-order cloud components with AWS CDK
License: MIT License
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.
You should be able to reflect on the CDK through jsii (see this) and auto-generate functional wrappers for all constructs.
I need to pass env
to the root stack, but I can't because pure.root
doesn't take props as an argument.
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)
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)
https://docs.aws.amazon.com/cdk/latest/guide/cfn_layer.html
Often it is required to Modifying the AWS CloudFormation Resource behind AWS Constructs.
The library should introduce a pure functional way to make it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.