Article

Python 3.14 on AWS: What You Can Use Today and What to Plan For

PythonPython 3.14 on AWS: What You Can Use Today and What to Plan For

by Gary Worthington, More Than Monkeys

Python 3.14 is shaping up to be one of the most practical updates in years. It introduces performance improvements, deferred type annotations, native Zstandard support, and a GIL-free interpreter build — all without breaking your existing codebase.

But if you’re deploying into AWS, it’s not always obvious what you can use right now and what’s still out of reach. Here’s a rundown of how Python 3.14 fits into AWS environments today, and what’s worth preparing for ahead of Lambda support.

Will AWS Lambda Support Python 3.14?

Not yet. As of July 2025, Lambda only supports up to Python 3.13. Python 3.14 is currently in beta and is expected to reach general availability in October 2025. AWS typically lags behind the core Python release by several months.

What You Can Do Now

  • Use container-based Lambdas to experiment with Python 3.14 in non-production environments
  • Create a custom Lambda layer with Python 3.14 if you understand the risks (advanced use only)
  • Start refactoring now: drop quoted type hints and move from f-strings to t-strings if you rely on templated output

Even if you’re not deploying to Lambda yet, aligning your code with what’s coming will reduce rework later.

Running Python 3.14 in ECS or EC2

If you control the runtime, you can begin testing the performance improvements in Python 3.14 today. The new tail-call interpreter and deferred type evaluation are both available in the current beta if you build Python from source.

⚠️ Note: Since Python 3.14 is still in beta, it should not be used in production environments just yet. Use ECS or EC2 for controlled experiments and testing only.

How to Build Python 3.14 for ECS or EC2

  1. Use Clang 19+
  2. Build with:
  3. ./configure --with-tail-call-interp --enable-optimizations make -j$(nproc)
  4. Package the build into your base Docker image or AMI

This setup gives you:

  • ~3–5% speedup from the new interpreter loop
  • Cleaner error messages
  • Deferred annotations without using __future__ or quotes
  • Native support for Zstandard compression

Python 3.14 and S3, Step Functions, Glue

Many developers use Python scripts as part of serverless or data workflows on AWS. Whether embedded in Step Functions, preprocessing S3 uploads, or doing transformations in Glue.

Here’s where Python 3.14 starts to make a difference:

Zstandard Support (PEP 784)

Use case: Faster and more compact compression for logs, payloads, or large datasets

import compression.zstd as zstd

data = b"your_data_here" * 1000
compressed = zstd.compress(data)
original = zstd.decompress(compressed

This is faster than gzip in most real-world scenarios and is now part of the standard library.

Deferred Annotations (PEP 649)

Use case: Less boilerplate and easier typing in scripts that are reused across jobs or environments

def transform(event: Event) -> Result:
...

No need for 'Event' or from __future__ import annotations—this just works now.

Debugging in EC2 and ECS: Attach by PID (PEP 768)

You can now attach a debugger to a running process using its PID:

python3.14 -m pdb -p <pid>

This is useful in EC2-based services or ECS containers where you don’t want to pre-load a debugger but need to diagnose a live issue.

Not supported in Lambda or Glue environments, but great for staging or internal services.

Summary: What AWS Engineers Should Do Now

If you’re using EC2 or ECS:

  • Begin testing Python 3.14 in non-production environments
  • Build from source with --with-tail-call-interp and profile-guided optimisation
  • Use compression.zstd in any data-heavy workloads
  • Start removing __future__ annotations and string-quoted types
  • Try debugger attach via pdb -p <pid> in dev or staging

⏳ If you’re using Lambda:

  • Wait for managed runtime support (likely mid-2026)
  • Use container Lambdas to evaluate Python 3.14 early, outside of production
  • Align code to t-strings and deferred annotations to reduce future migration effort

Final Note

Python 3.14 introduces meaningful improvements that will benefit AWS developers once the version is officially supported. If you control your runtime, it’s worth experimenting with the beta today, but keep it away from production for now.

When general availability arrives, these features will help streamline typing, improve startup and runtime speed, and make debugging and packaging simpler.

Let me know if you want a Dockerfile or Lambda container example based on Python 3.14 - I’m already testing this internally and happy to share.