Skip to content
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

Support for Java21 as runtime for AWS Lambda functions #12273

Open
1 task done
debae opened this issue Nov 24, 2023 · 16 comments
Open
1 task done

Support for Java21 as runtime for AWS Lambda functions #12273

debae opened this issue Nov 24, 2023 · 16 comments

Comments

@debae
Copy link
Contributor

debae commented Nov 24, 2023

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Use case description

Java 21 is now also supported by AWS as runtime : https://aws.amazon.com/about-aws/whats-new/2023/11/aws-lambda-support-java-21/
We should have this option as well in the supported runtimes of serverless framework

Proposed solution (optional)

Add java21 as option in the enum :


add the option in :
if (['java8', 'java11'].includes(runtime)) {

Update documentation about snapstart since this also supports Java21 :
**Note:** Lambda SnapStart only supports the Java 11 runtime and does not support provisioned concurrency, the arm64 architecture, the Lambda Extensions API, Amazon Elastic File System (Amazon EFS), AWS X-Ray, or ephemeral storage greater than 512 MB.

debae added a commit to debae/serverless that referenced this issue Nov 24, 2023
debae added a commit to debae/serverless that referenced this issue Nov 24, 2023
Mmarzex pushed a commit that referenced this issue Nov 26, 2023
* feat: Add support for java17 runtime (#12273)

* feat: Add support for java21 runtime (#12273)
khacminh pushed a commit to khacminh/serverless that referenced this issue Nov 29, 2023
…2274)

* feat: Add support for java17 runtime (serverless#12273)

* feat: Add support for java21 runtime (serverless#12273)
@monigala
Copy link

monigala commented Jan 17, 2024

What's the deal with this ticket. Is it merged or no? I am seeing this error running the latest version (framework 3.38.0)

<html>
<body>
<!--StartFragment-->
Error:
--
375 | Configuration error at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x, provided, provided.al2, provided.al2023, python3.7, python3.8, python3.9, python3.10, python3.11, ruby2.7, ruby3.2]
376 |  
377 | Learn more about configuration validation here: http://slss.io/configuration-validation

<!--EndFragment-->
</body>
</html>

So java21 is not supported?? When can we expect support for this??

@noelmccrory
Copy link

noelmccrory commented Jan 17, 2024 via email

@monigala
Copy link

Looks like it's merged but there hasn't been a release since.

On Wed, 17 Jan 2024, 17:39 Andy Monigal, @.> wrote: What's the deal with this ticket. Is it merged or no? I am seeing this error running the latest version Error: -- 375 | Configuration error at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x, provided, provided.al2, provided.al2023, python3.7, python3.8, python3.9, python3.10, python3.11, ruby2.7, ruby3.2] 376 | 377 | Learn more about configuration validation here: http://slss.io/configuration-validation So java21 is not supported?? — Reply to this email directly, view it on GitHub <#12273 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVUUZBGDRL4I4U6VWE4JTDYPAEFRAVCNFSM6AAAAAA7YT6VSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGI4DQMJWGY . You are receiving this because you are subscribed to this thread.Message ID: @.>

Gotcha. Does anyone know when the next scheduled release will be?

@debae
Copy link
Contributor Author

debae commented Jan 31, 2024

It was merged to the main branch, however the code is not in the v3 branch which is used to create the latest versions of the serverless framework. @medikoo or @Mmarzex what is the plan here ?

@Mmarzex
Copy link
Contributor

Mmarzex commented Feb 9, 2024

Hi @debae this will be supported in our framework v4 beta that will be released within the next week.

@TedGrahamEmporia
Copy link

Was the v4 beta released? Where can we try it out?

@mgerlach
Copy link
Contributor

Will this also go into v3?

@dfelsman-ta
Copy link

Where / when did this happen.

@amonigal
Copy link

@Mmarzex Any update on this?

@mgerlach
Copy link
Contributor

It does not look like we will ever see this in v3. You can still use 'java21' and ignore the warning.

@amonigal
Copy link

It does not look like we will ever see this in v3. You can still use 'java21' and ignore the warning.

Per the post from Jan 17th above, its not a warning. It's throwing an exception and failing to deploy. I don't understand what you mean You can still use 'java21'.... The whole point of this issue is you can't use java 21 (in v3).

@noelmccrory
Copy link

If you're waiting for V4 to drop just so you can upgrade to Java 21, keep in mind the licensing changes that are coming with V4.

Starting in 2024, the Serverless Framework CLI remains free for most users. However, all organizations that earned over $2M in their last fiscal year must purchase a Serverless Subscription which includes a license to use Serverless Framework V.4 and beyond.

You do not have to buy a License for Serverless Framework V.3 and less. V.3 will continue to receive essential security and bug fixes throughout 2024.

@mgerlach
Copy link
Contributor

mgerlach commented Apr 25, 2024

It does not look like we will ever see this in v3. You can still use 'java21' and ignore the warning.

Per the post from Jan 17th above, its not a warning. It's throwing an exception and failing to deploy. I don't understand what you mean You can still use 'java21'.... The whole point of this issue is you can't use java 21 (in v3).

I mean that with this setting in serverless.yml,

provider:
  name: aws
  runtime: java21

I'm getting this warning

> node_modules/.bin/serverless deploy --verbose --stage prod 

Warning: Invalid configuration encountered at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x, provided, provided.al2, provided.al2023, python3.7, python3.8, python3.9, python3.10, python3.11, ruby2.7, ruby3.2] 

Learn more about configuration validation here: http://slss.io/configuration-validation 

Deploying ... to stage prod (eu-central-1) 
...

and the Lambda will be deployed with Java 21 runtime.

I use serverless 3.38.0, Node.js 20, MacOS and GitHub Actions ubuntu-latest runners.

@amonigal
Copy link

amonigal commented Apr 25, 2024

It does not look like we will ever see this in v3. You can still use 'java21' and ignore the warning.

Per the post from Jan 17th above, its not a warning. It's throwing an exception and failing to deploy. I don't understand what you mean You can still use 'java21'.... The whole point of this issue is you can't use java 21 (in v3).

I mean that with this setting in serverless.yml,

provider:
  name: aws
  runtime: java21

I'm getting this warning

> node_modules/.bin/serverless deploy --verbose --stage prod 

Warning: Invalid configuration encountered at 'provider.runtime': must be equal to one of the allowed values [dotnet6, go1.x, java17, java11, java8, java8.al2, nodejs14.x, nodejs16.x, nodejs18.x, nodejs20.x, provided, provided.al2, provided.al2023, python3.7, python3.8, python3.9, python3.10, python3.11, ruby2.7, ruby3.2] 

Learn more about configuration validation here: http://slss.io/configuration-validation 

Deploying ... to stage prod (eu-central-1) 
...

and the Lambda will be configured to run on Java 21

I use serverless 3.38.0, Node.js 20, MacOS and GitHub Actions ubuntu-latest runners.

I am using AWS CodeCommit + AWS CodePipeline + AWS CodeBuild and it's not a warning/deploying.

image
image

image
image
image

@zhemaituk
Copy link

@amonigal you probably have configValidationMode: error in serverless.yml. Remove or comment it out:

# TODO: Uncomment once https://github.com/serverless/serverless/issues/12273 is addressed (java21 support).
# configValidationMode: error

@amonigal
Copy link

amonigal commented May 2, 2024

@amonigal you probably have configValidationMode: error in serverless.yml. Remove or comment it out:

# TODO: Uncomment once https://github.com/serverless/serverless/issues/12273 is addressed (java21 support).
# configValidationMode: error

@zhemaituk Thank you. You were correct. Changing configValidationMode: error to configValidationMode: warn worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants