-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(lambda): add SnapStart support for arm64 functions #30898
Conversation
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 pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
In the meantime while this gets merged and officially released, people wanting to use SnapStart on their arm64 functions, need to use the workaround that was used before SnapStart was supported in the function L2 construct: const fn = new lambda.Function(this, 'Func', {
runtime: lambda.Runtime.JAVA_21,
handler: 'example.Handler',
architecture: lambda.Architecture.ARM_64,
code: lambda.Code.fromAsset(path.join(__dirname, '../../lambda/example.jar')),
memorySize: 256,
});
// Workaround: Add SnapStart configuration like this:
(fn.node.defaultChild as lambda.CfnFunction).addPropertyOverride('SnapStart', {
ApplyOn: 'PublishedVersions',
}); |
@@ -967,7 +967,7 @@ managing concurrency. | |||
|
|||
## Lambda with SnapStart | |||
|
|||
SnapStart is currently supported only on Java 11/Java 17 runtime. SnapStart does not support provisioned concurrency, the arm64 architecture, Amazon Elastic File System (Amazon EFS), or ephemeral storage greater than 512 MB. After you enable Lambda SnapStart for a particular Lambda function, publishing a new version of the function will trigger an optimization process. | |||
SnapStart is currently supported only on Java 11/Java 17 runtime. SnapStart does not support provisioned concurrency, Amazon Elastic File System (Amazon EFS), or ephemeral storage greater than 512 MB. After you enable Lambda SnapStart for a particular Lambda function, publishing a new version of the function will trigger an optimization process. |
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.
SnapStart is also available on Java 21.
You might want to flip this around to say "SnapStart is not available on Java 8 (AL1 or AL2)" or words to that effect.
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.
We need to mention that it's only supported in Java, so we can't leave "just Java8" out of the support. (Yes, @msailes, there are other runtimes other than Java 😉)
The official documentation mentions "SnapStart supports Java 11 and later Java managed runtimes", so we can go with something like that.
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.
LGTM!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main 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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
### Issue # (if applicable) Closes aws#30899. ### Reason for this change Lambda released SnapStart support for arm64 functions: https://aws.amazon.com/about-aws/whats-new/2024/07/aws-lambda-snapstart-java-functions-arm64-architecture/ ### Description of changes Allow configuring SnapStart on arm64 functions. ### Description of how you validated changes ```yarn test``` ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Issue # (if applicable)
Closes #30899.
Reason for this change
Lambda released SnapStart support for arm64 functions: https://aws.amazon.com/about-aws/whats-new/2024/07/aws-lambda-snapstart-java-functions-arm64-architecture/
Description of changes
Allow configuring SnapStart on arm64 functions.
Description of how you validated changes
yarn test
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license