Update Lambda Runtime (pyhton 3.9 to 3.11)

0

I have many lambdas were created with CDK and I want to update the runtime. I've done these changes:

  • I Updated python 3.11 in Cloud9 (also in venv)
  • I Changed the CDK code where modify the runtime like this:
runtime=lambda_.Runtime.PYTHON_3_9  -> runtime=lambda_.Runtime.PYTHON_3_11

But I get this error when I try to deploy: RuntimeError: This lambda function uses a runtime that is incompatible with this layer (python3.11 is not in [python3.9])

This is part of the content of my requirements.txt file:

aws-cdk-lib==2.118.0
aws-cdk.aws-lambda-python-alpha==2.118.0a0
aws_ddk_core==1.4.0
boto3==1.34.12

Why Do I get that error? What have to do if I want to update the runtime?

1 Antwort
1
Akzeptierte Antwort

You have layers attached to the lambda function. On the layers you define the version of python that they are compatible with.

They will need to be updated too.

profile picture
EXPERTE
beantwortet vor 3 Monaten
profile picture
EXPERTE
überprüft vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen