-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the issue
I'm trying to use the classic pattern where you have an infrastructure stack and a code stack. I want to define these two stacks as peer stacks, and directly reference resources in the infrastructure stack from the code stack. When I started doing this, I quickly encountered a cyclic reference error that I've opened a separate bug issue for.
However I'm wanting to know whether this is a usage pattern that the CDK team support in general, and whether the CDK consider this poor practice or good practice; before I commit to it and then potentially find I'm stuck because I'm using the CDK in an unsupported fashion.
I'm not interested in using nested stacks for this. When I worked with Nested Stacks back when I was an AWS employee I found them quite clunky to work with, although this was a few years ago.
I'm currently using peer stacks, with the infrastructure stack exporting resource ARNs using CfnOutput, and the code stack then importing them using Fn.importValue. But it would be cleaner if I could safely pass the actual CDK constructs from the infrastructure stack to the code stack.