-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use the same Lambda version for 2 CloudFront distributions #4459
Comments
cc @skyrpex |
Is there a workaround for this? |
You can create as many lambdas as CloudFront distributions you got. |
I believe the problem is with the dual reference to aws-cdk/packages/@aws-cdk/aws-lambda/lib/function-base.ts Lines 246 to 248 in 9ff55ae
A workaround could be storing the latest version in a const, and passing an const sharedPwaLambdasStack = new SharedPwaLambdasStack(app, "SharedPwaLambdas");
const latestVersion = sharedPwaLambdasStack.addCspHeadersFunction.latestVersion;
const websitePwa = new PwaStack(app, "WebsitePwa", {
addCspHeadersFunctionVersion: latestVersion,
});
// If you comment the following stack, it will work.
const adminPwa = new PwaStack(app, "AdminPwa", {
addCspHeadersFunctionVersion: latestVersion,
}); |
…utions The error produced is around construct collision, i.e., "There is already a Construct with name '$LATEST' in Function". The fix is to cache the latest version on the instance. fixes #4459
…utions The error produced is around construct collision, i.e., "There is already a Construct with name '$LATEST' in Function". The fix is to cache the latest version on the instance. fixes #4459
…utions (#9966) The error produced is around construct collision, i.e., "There is already a Construct with name '$LATEST'". The fix is to cache the latest version on the instance. fixes #4459 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I am getting this error, please help me how to get this error resolved...? I am defining 2 lambda functions in a same stack, is this the reason?
` |
From #4237:
Reproduction Steps
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: