Comments (3)
Thank for raising the issue! Indeed, this is current limitation. In order to overcome this limitation you can use
const app = new cdk.App()
const config = {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
}
}
const stack = new cdk.Stack(app, 'mystack', { ...config })
pure.join(stack, ...)
What is the right evolution of root
? It requires a consideration, e.g. a new parameter would not make usage of pure.root
easier than new cdk.Stack
.
export function root<T>(scope: App, fn: IaaC<T>, name?: string, props?: cdk.StackProps): App {
fn(new Stack(scope, name || fn.name), props)
return scope
}
Atm I am considering the following construct, however it would introduce incompatible change.
// root is an App
const app = pure.root()
// Stack is just any other construct
const MyStack = (): cdk.StackProps => ...
const stack = pure.iaac(MyStack)
pure.join(app, stack)
from aws-cdk-pure.
The second solution seems simpler. But why do we need root
at all? Isn't it possible to do this:
const app = new cdk.App();
const config = { env };
pure.join(app, cloud.stack(() => config, 'MyApp').effect(MyStack));
So root
doesn't seem to provide much benefit except for initializing the Stack
for you, and that's not too difficult.
Edit: maybe I'm oversimplifying things. Getting the types to work out is probably difficult.
from aws-cdk-pure.
Exactly! The root
is not needed at all. I do have same opinion. I think, I just deprecate it.
from aws-cdk-pure.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-cdk-pure.