I occasionally steal bits and pieces from CDK cons...
# pulumi-cdk
l
I occasionally steal bits and pieces from CDK constructs to use in my Pulumi components (eg policy building stuff, because cdk handles it really nicely). As of very recently I've noticed a regression in that CDK constructs when used within Pulumi (even without the Pulumi-cdk interop) will cause nodejs to hit the recursion stack limit and bail. Anyone else happen to use cdk stuff in TS Pulumi and is seeing this?
n
Hey Connor, I'm actually working on the pulumi-cdk interop library right now in order to stabilize it for a v1 release. Do you have an example I can look at? It definitely shouldn't be doing that!
l
This is a relatively large project so there may be other contributing factors. I'll see if I can put together a reproduction repo
n
I would also be curious how you are using it without the pulumi-cdk interop since that shouldn't be possible
l
I made a little 'PolicyBuilder' class that does some faking of the CDK construct context in order to allow me to put together and minimise policies easier by using CDK's PolicyDocument. It didn't need true interoperability, just the ability to resolve outputs and render into JSON. I assumed at first it was the PolicyBuilder hacks that caused it to hit the stack limit. Coincidentally a little while later I was experimenting with something else with the actual interop library (without my hacky policybuilder) and encountered the same issue, which made it feel like a wider issue, hence my question in here. In particular the thing that caused it to go crazy was when trying to build an
assumeRolePolicy
, if I added an
IPrincipal
to it in any way it would quickly error out. If you aren't seeing that issue, I'd be inclined to believe it's on my side