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


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)

已提问 3 个月前614 查看次数
2 回答

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:

    Type: AWS::Lambda::Function
      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
已回答 3 个月前

I had the same issue on one of the first steps of the SageMaker tutorial:

The above answer worked, but specifically, the directions for editing the CloudFormation template are here:

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.

已回答 2 个月前

您未登录。 登录 发布回答。