-
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
chore(lambda): current version for singleton functions #9892
Conversation
Add `currentVersion` for singleton functions. This makes it possible to use them for Lambda@Edge. Also remove deprecated calls to `addVersion()` introduced in aws#9562.
@jogold Will this also allow |
No, but if you're importing you know the version, no?: lambda.Version.fromVersionArn(this, 'Version', 'arn:aws:lambda:region:account-id:function:function-name:version') |
if (this.lambda instanceof FunctionBase) { | ||
if (this.lambda instanceof Function) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why you've removed the default implementation of _checkEdgeCompatibility()
and changed this line.
Why not run _checkEdgeCompatibility()
if it is any kind of FunctionBase
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason we needed to implement it at the FunctionBase
level was because the singleton function's ensureLambda()
was returning an IFunction
instead of a Function
which is incorrect.
Now that the singleton function is fixed (in terms of typing) we don't need this at the FunctionBase
level: we will never check imported functions for edge compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Add
currentVersion
for singleton functions. This makes it possible touse them for Lambda@Edge.
To achieve this, make
ensureLambda()
return aFunction
and not anIFunction
(which now allows to remove the default implementation of
_checkEdgeCompatibilty()
in
FunctionBase
).Also remove deprecated calls to
addVersion()
introduced in #9562.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license