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

The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions. #402

Closed
alc-aardvark opened this issue Mar 2, 2024 · 10 comments
Labels
bug We can reproduce the issue and confirmed it is a bug. publish

Comments

@alc-aardvark
Copy link

Describe the bug

I have a .Net8 Blazor Wasm website that I am trying to deploy to AWS from the Visual Studio "Publish to AWS" command. During the deployment it gets a failure while running the Cloudformation Stack.

The Error is "Stack Deployments Failed: Error: The stack named XXXWebsite failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Resource handler returned message: "The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: ac2f1dd6-cf04-43f8-b18a-5e154cd48bfb)" (RequestToken: efec29a8-e202-1437-3835-9f2fe724910a, HandlerErrorCode: InvalidRequest)"

To Reproduce

Steps to reproduce the behavior

  1. Create a new Blazor Wasm project in Visual Studio 2022
  2. Build it and see that it runs locally
  3. right click on the project and click "Publish to AWS ..."
  4. During the deployment it will fail and rollback

Expected behavior

I expect the deployment to complete without errors

Screenshots

Toolkit Logs

Development System (please complete the following information):

  • Windows Version: Windows 11
  • Visual Studio Version: VS2022
  • AWS Toolkit for Visual Studio Version: 1.48.0.0
  • SAM version: 1.110.0

Additional context

The website template.json file in the folder ".aws-dotnet-deploy/projects" recreates a *template.json file for the deploy and it has the nodejs version of 14.0x. I believe the aws codegen is codegenning with an old value of nodejs that is no longer supported by AWS and so the cloudformation stack fails when trying to create the nodejs Lambda function Custom::S3AutoDeleteObjectsCustomResourceProvider/Handler

@alc-aardvark alc-aardvark added the bug We can reproduce the issue and confirmed it is a bug. label Mar 2, 2024
@alc-aardvark
Copy link
Author

Here is the failing cloudformation stack template that shows its is trying to use nodejs14.x which causes the failure
blazorwasmCFTemplate.txt

@alc-aardvark
Copy link
Author

If I kill a manual "dotnet aws deploy" after it has uploaded the files to S3 and before it tries to run the CF stack, and then

  • find the json file for the CloudFormation and download it, modify the nodesjs14.x to be nodejs16.x
  • re-upload this to S3
  • create a manual CF Stack using this updated file
  • run the CF stack

then it works.

NB. I tried using nodejs20.x and this failed.

@james-hoo
Copy link

I had the same problem。

@edreinoso
Copy link

This issue is also present in my case.

@alc-aardvark you seemed to have found an interesting workaround, but this should ideally work out of the box, right?

@rbbarad
Copy link
Contributor

rbbarad commented Mar 8, 2024

Thanks for reaching out. Work is currently in progress to update the Deploy Tool's Blazor recipe to use a newer CDK version that relies on Nodejs20.x: aws/aws-dotnet-deploy#818. When this improvement becomes available in a future release of the deploy tool, we'll be able to onboard it to the Toolkit's Publish to AWS experience.

@casontek
Copy link

what is the accepted solution for this issue

@shruti0085
Copy link
Contributor

We are not aware of a workaround for this issue today. As mentioned, we are tracking work to address this here: aws/aws-dotnet-deploy#818 and will update the toolkit once it is fixed.

@alc-aardvark
Copy link
Author

looks like an update is available in v 1.19.13

do the following from a command prompt to update

dotnet tool update -g aws.deploy.tools

@awschristou
Copy link
Contributor

I've re-opened this issue until we have the same deploy tool fix available within the Toolkit

@floralph
Copy link
Contributor

floralph commented Apr 1, 2024

We've recently released version 1.50.0.0 of the toolkit and you can now deploy Blazor projects without this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug. publish
Projects
None yet
Development

No branches or pull requests

8 participants