(cloudfront): Lamda@Edge synth fails with newStyleStackSynthesis #12172
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p1
If newStyleStackSynthesis is enabled in a CDK stack and the stack uses a Lamda@Edge function, the synth-action leads to an error:
Cannot add assets to a Stack that uses the BootstraplessSynthesizer
Reproduction Steps
Create a new CDK project and enable newStyleStackSynthesis in
cdk.json
by adding"@aws-cdk/core:newStyleStackSynthesis": true
.Add a Lambda@Edge function to the new stack as described in the documentation:
Set the region to a value which is different to us-east-1.
Execute
cdk synth
.What did you expect to happen?
CDK stack should be synthesized successfully.
What actually happened?
Error message appears:
Cannot add assets to a Stack that uses the BootstraplessSynthesizer
Environment
Other
In class edge-function.ts, the method crossRegionSupportSynthesizer returns the BootstraplessSynthesizer.
For testing, I replaced
with
After doing this change, I could deploy my stack and the edge-lambda-stack successfully. Is this the correct fix for the issue?
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: