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