Open lukehoban opened 1 year ago
hey!
cool prototype - we definitely can make this easier. with SST2 a lot of this might get more difficult but we paved the way to not needing sst.App
and sst.Stack
if those two dependencies are gone this should "just work" like any other CDK construct right?
Thanks @thdxr!
if those two dependencies are gone this should "just work" like any other CDK construct right?
Yes - I would expect so. The only challenges today are that when sst
constructs are used from within vanilla cdk.App
and cdk.Stack
they fail due to assumptions these constructs make that the stack/app they are a part of has certain SST-specific features.
I do think we should be able to address this on the Pulumi bridge layer side as well - in principle there is no reason you shouldn't be able to use sst.Stack
and sst.App
with our bridge.
BTW - do you have any canonical examples of using SST constructs entirely outside of SST, from within a "normal AWS CDK" stack? Like if I wanted to use SST constructs but without using the sst
CLI for workflow? I'd love to try porting a few of those to deploy via Pulumi as an alternative option (both to make sure it's possible, and to compare performance and highlight some of the other benefits - like mixing and matching across other providers, etc.).
sst v3 (Ion) is now built on Pulumi and uses Pulumi components instead of CDK constructs. Looking into this a little, it looks like the components are not published anywhere so I don't think it is easy to use them.
It looks like the sst cli might download the source code for the components locally so it might be possible to use them in a pulumi app, but it will take some more investigation.
Serverless Stack (https://sst.dev) defines a collection of nice high-level CDK constructs for Serverless workloads.
It would be very nice to be able to deploy these via Pulumi.
In trying to use them via this Pulumi AWS CDK bridge, I ran into a few problems:
cdk.Stack
andcdk.App
- they must be used withsst.Stack
andsst.App
which derive from the CDK equivalents.pulumicdk.Stack
also inherits fromcdk.Stack
, and there is no way to chain these three together currently. I was able to hack around this for at least one usecase, but we'll need to think about whether we can make it possible to use pulumicdk bridge with stacks that must be subclasses ofcdk.Stack
.pulumicdk.Stack
creates thecdk.App
automatically. We should instead allow users to pass in the App (or at the very least, the App constructor), so that ansst.App
can be constructed and used as the app for the Pulumi stack.I was ultimately able to get this to work: