-
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
(aws-cloudfront): CloudFront IFunction
interface is structurally compatible with Lambda's IFunction
, but not compatible in AWS
#16885
Comments
Thanks for submitting this issue @moltar, Seems to me like this is a consequence of the lambda |
That is correct.
There is a way to do this, it's a bit hack-ish, using nominal typing. |
Yeah, just about the only way to fix this would be to add a conflicting parameter between the two (e.g., an extra prop to CloudFront's |
Probably too late, but at least aming the interface differently would be good. Maybe |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Not stale. |
@moltar Good afternoon. As mentioned in the #16885 (comment), this is a consequence on how TypeScript works. Are you able to see the same issue in other languages (such as .NET, Java or Python)? I'm unsure if it is feasible to raise the error during build time. |
I don't think it'd be unreasonable to bring |
@kylelaker FunctionProps does have the |
Sure, but that's not exposed in I didn't look into whether |
What is the problem?
I am able to assign a Lambda function to CloudFront function (matching TypeScript interfaces), but when the solution is deployed, it produces an error, as Lambda functions cannot be used as CloudFront functions.
Reproduction Steps
What did you expect to happen?
Interfaces to be incompatible and get an error in the IDE and at build time.
What actually happened?
No error was produced in the IDE or at build time.
Error happened during the deployment:
CDK CLI Version
1.126.0 (build f004e1a)
Framework Version
1.126.0
Node.js Version
v14.17.5
OS
macOS
Language
Typescript
Language Version
TypeScript 4.4.3
Other information
No response
The text was updated successfully, but these errors were encountered: