- Newest
- Most votes
- Most comments
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.
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.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 25 days ago
I'm following a Beginner Tutorial that is meant to take 20 minutes but it looks like no one maintains these tutorials or tests that they work. This is really poor. I've found AWS really hard going so far with lots of things that don't work and lots of tutorials that don't reflect current functionality. https://aws.amazon.com/getting-started/hands-on/machine-learning-tutorial-generate-predictions-without-writing-code/?ref=gsrchandson