CloudFormation Stack creation failure due to DelayLambda "The runtime parameter of python3.7 is no longer supported..."

0

Is it possible to fix this so CloudFormation Stack creation completes successfully.

"The runtime parameter of python3.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.12) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: a482cb7a-a321-4560-b60b-0ddea25ed91f)" (RequestToken: 89bae452-30d2-86a6-7d6b-931422d6267f, HandlerErrorCode: InvalidRequest)

Dom
asked 2 months ago401 views
2 Answers
1

To resolve the error, you need to update the Lambda function runtime in your CloudFormation template to python3.12.

When deploying Lambda functions using CloudFormation, change the Handler and Runtime properties under the Lambda function resource:

Resources:
  Function:
    Type: AWS::Lambda::Function
    Properties: 
      Handler: index.handler
      Runtime: python3.12

Then, update your CloudFormation stack with the modified template. This will ensure the Lambda function is created or updated with the supported python3.12 runtime.

You may also need to update any other resources like S3 buckets or triggers that reference the Lambda function.

Refer to the AWS documentation for details on updating CloudFormation stacks and the latest supported runtimes for Lambda functions. Updating the template with the current runtime should allow the stack deployment to complete successfully.

profile picture
EXPERT
answered 2 months ago
0

I had the same issue on one of the first steps of the SageMaker tutorial: https://aws.amazon.com/tutorials/machine-learning-tutorial-label-training-data/

The above answer worked, but specifically, the directions for editing the CloudFormation template are here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-get-template.html.

In CloudFormation, in the stack, I clicked on the Template tab, then "View in Application Composer". It doesn't seem to work there, so I clicked "Go to Designer" at the top. On the screen that appears, at the bottom will be the text template. Press Ctrl+F, then search for all instances of "3.7" and replace it with "3.12". Then at the top, click the little file button, then Save, and choose Local File.

Now that the template is on your computer, go back to CloudFormation console on the Stacks page. Click Create Stack > With new resources. Select "Upload a template file", browse for the file you made and downloaded, then press Next. Enter a Stack name and press Next. Then press Next again. And finally, click the checkbox, and then Submit to create the stack.

Modarn
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions