-
Notifications
You must be signed in to change notification settings - Fork 4.4k
(cdk-pipelines): newStyleStackSynthesis confusion #18572
Description
link to reference doc page
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html
Describe your issue?
I've stumbled upon this on CDK Pipelines API doc (from module README), where it the "@aws-cdk/core:newStyleStackSynthesis": true is a requirement. I guess v2 has the new style by default, right?
It is mentioned on this reference page twice. One is the confusing case for v2, the other could be informative for v1 users, but maybe should be in migration guide instead?
When started to look into code I've found that if newStyleStackSynthesis is true then DefaultStackSynthesizer is used (instead of LegacyStackSynthesizer), just like this API doc says:
aws-cdk/packages/@aws-cdk/core/lib/stack.ts
Line 127 in 77144f5
| * @default - `DefaultStackSynthesizer` if the `@aws-cdk/core:newStyleStackSynthesis` feature flag |
My project is started on CDK 2.0.0 and is 2.8.0 now, so it should not be necessary any more and using new style by default.
My cdk.json does not have this setting at all, so I'd assume it would be false (meaning legacy synthesizer). This is how I would conclude from the docs and from the feature flags code that I've read. However when I've checked one of my stacks it was using DefaultStackSynthesizer - that is expected behavior, but not what's documented.