To do it in the AWS Console, go to the Lambda console, find your function and click on its name. (e.g., eu-west-1 console). Scroll down toward the bottom of the page and look for "Runtime settings". Click "Edit" and then you can pick the new runtime from the available runtimes in the list.
Alternatively, you can use the command line to find all the Lambda functions that have the python3.6
runtime:
aws --region REGION lambda list-functions \
--query 'Functions[?Runtime == `python3.6`].FunctionName'
That command will return a list of function names that have the python3.6
runtime.
Note that Lambda is a regional service, so you have to run that command line in each region where you've deployed Lambda functions, and change the value of REGION
to something like eu-west-1
to check for functions in that region.
If you're super confident and just want to YOLO it, you can then run this command to update the runtimes on the functions. For each function Name that you got from the prior command, do this:
aws --region REGION lambda update-function-configuration \
--function-name "FUNCTION-NAME" --runtime 'python3.8'
You have to put the value for your region and the value of the function name in the CLI.
If you're deploying your lambdas via CloudFormation or CDK, you don't do this at all. You update your CloudFormation or your CDK, and then you make a ChangeSet and then you deploy the ChangeSet.