What should I check when moving Lambda functions from Python 3.10?

November 17, 2026 5 answers
Asked by 4v!drelvix_306

I have Lambda functions on Python 3.10 and need to plan a move to a newer runtime. What tends to break when jumping to 3.12 or 3.13, and how would you approach the migration?

Answers

Kelmira-9f

Start by finding every affected function in each account and Region, including published versions. Then check AWS's current runtime deprecation schedule before setting your deadline. Deprecation, the block on creating functions, and the block on updating functions are separate milestones.

Python 3.11 can be a stepping stone, but it stays on Amazon Linux 2 and has its own deprecation date. Going to 3.12 or later also changes the underlying OS to Amazon Linux 2023, so test that as a platform migration, not just a Python version bump.

Reply to this answer
Tavelo

Check the imports and build tooling first. Python 3.12 removed distutils, so an old library or setup script may fail even if your application never imports it directly. Updated setuptools or packaging tooling can help, but you may need to upgrade the dependency itself.

If you go to 3.13, also look for removed standard library modules such as cgi, crypt and telnetlib. Run your tests against the target version before changing the Lambda runtime.

Reply to this answer
_j49~crispindle.3

Don't reuse native packages blindly. Rebuild and test packages and layers with compiled components for the target Python version, Linux environment and architecture. That includes things like NumPy, psycopg2 and cryptography. A successful build on a laptop doesn't prove the package will import in Lambda.

Pydantic is worth checking separately if you're on v1. Moving to v2 can introduce behavior changes, and pydantic-core is compiled. The pydantic.v1 compatibility namespace can help stage that migration if switching everything at once is too much.

Marnilo-8v:

Test the actual deployed package or layer too. Import checks in the target runtime can catch native dependency problems before they show up during an invocation.

Reply to this answer
q.731+brindlefob

Check your requests and urllib3 pins, especially if outbound HTTPS starts failing after the OS change. Older dependency combinations can run into OpenSSL compatibility problems on Amazon Linux 2023. Review the versions together rather than upgrading one package without checking its constraints.

Where possible, update and test those dependencies on 3.10 first, then change the runtime in a separate deployment. It makes failures easier to isolate.

Reply to this answer
8d+tramwinder_461

A container image is another packaging option if the managed runtime doesn't fit your migration yet. It isn't a free pass on maintenance, though. You still need to update and redeploy the image to pick up security fixes for the OS, Python and dependencies.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions