1
votes

AWS Lambda function upgrade requires me to upgrade to 2.1 to deploy my lambda function changes.

I have done the solution upgrade to dotnet runtime to 2.1 and serverless runtime with dotnetcore2.1

Still, I am getting the issue on serverless deployment

An error occurred: LambdaFunction - The runtime parameter of dotnetcore2.0 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (dotnetcore2.1) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException

It works if we deploy newer serverless service. It causes issue with existing function upgrade.

2
Ran into exactly the same issue today. Please share the solution if you find one.Sateesh Pagolu
@sateesh are just upgrading your existing 2.0 function with 2.1 same like me?Parth Trivedi

2 Answers

3
votes
  1. Open browser, go into AWS Console/Lambda/Functions/YourFunction .

  2. On the "Function Code Section" the "Runtime" dropdown must be blank.

  3. Set it to NetCore 2.1 C# Powershell and Save.

  4. All done. Upload function as usual.

Why the Visual Studio Tool does not set this by itself when you select the runtime at upload its a mistery.

0
votes

I worked around this issue by changing logical ids of lambdas that I was updating. This way, CloudFormation deletes old lambdas and creates brand new lambdas with new runtime. Unfortunately, this seems to be the only way for now as updates to any lambda pointing to 2.0 runtime is deprecated (event if the update is upgrading the runtime).

Not an ideal way to do it, but does the job.