-
As I am starting to build my App with the CDK I am realising that the ***-stack.ts file is growing in size beyond the pale.
Where the ***-stack.ts file would import all the **.js files from the different subfolders. I gave a go at this but got the following error: (I am running a TypeScript codebase) Any suggestion? Cheers Stephane |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think what you're wanting to do is write your own constructs. (https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_author) Another route could be to use Nested stacks, but I think for the problem you're describing writing constructs would probably be the preferable route. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I think what you're wanting to do is write your own constructs. (https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_author)
You can group resources into constructs and instantiate those in your Stack for composition.
Another route could be to use Nested stacks, but I think for the problem you're describing writing constructs would probably be the preferable route.