amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

DdbToEsFn python streaming function uses deprecated and soon retired Python v3.9

Open houmark opened this issue 4 months ago • 14 comments

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

22.18.0

Amplify CLI Version

14.0.0

What operating system are you using?

MacOS

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

This was an issue in 2022 with Python 3.6 but now it's again an issue with the latest version.

I did try just forcing Python v3.12 but there are some breaking changes with collections in the code, and other potential concerns related to unicode chars, so I stopped there since I'm not real strong in Python.

Running Amplify Gen 1.

Expected behavior

That Amplify keeps dependencies of auto-generated functions up to date and within supported AWS Lambda version range.

Reproduction steps

Nothing, just run Amplify with @searchable.

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • [x] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [x] I have removed any sensitive information from my code snippets and submission.

houmark avatar Aug 17 '25 05:08 houmark

Current vs Expected Behavior

Current Behavior

// When using @searchable directive in GraphQL schema
type Post @model @searchable {
  id: ID!
  title: String!
  content: String!
}

Result: Amplify CLI generates a DdbToEsFn Lambda function using Python 3.9 runtime, which is deprecated and will be retired by AWS.

Expected Behavior

// Same GraphQL schema with @searchable
type Post @model @searchable {
  id: ID!
  title: String!
  content: String!
}

Expected Result: Amplify CLI should generate the DdbToEsFn Lambda function using a supported Python runtime (Python 3.11 or 3.12) that is within AWS Lambda's supported version range.


Hi @houmark,

Thank you for reporting this issue! You're absolutely right that this is a recurring problem. We had the same issue in 2022 with Python 3.6 (issue #10236), and now it's happening again with Python 3.9.

The Problem: The DdbToEsFn streaming function generated by the @searchable directive is using a hardcoded Python 3.9 runtime, which AWS is deprecating. This affects all Amplify Gen 1 users who use the @searchable directive.

pahud avatar Aug 20 '25 15:08 pahud

Thanks, looking forward to this being resolved.

Also, I unfortunately won't be able to contribute to this one. As I mentioned in my original bug report, my Python level is not strong enough for that.

houmark avatar Aug 20 '25 20:08 houmark

Hey @pahud — any update on this one? We're just a few short months away from the current Python version used for this script by Amplify being retired by AWS.

houmark avatar Oct 01 '25 19:10 houmark

Received another warning in our Health Dashboard that Python 3.9 will soon be end-of-life.

Anything new from the Amplify team on when we can expect this is fixed?

houmark avatar Oct 15 '25 08:10 houmark

Hello,

[AWS Health may periodically trigger reminder notifications about this communication if resources remain unresolved.]

We are contacting you as we have identified that your AWS Account currently has one or more AWS Lambda functions using the Python 3.9 runtime.

We are ending support for Python 3.9 in Lambda on December 15, 2025. This follows Python 3.9 End-Of-Life (EOL) reached on October 30, 2025 [1]. End of support does not impact function execution. Your functions will continue to run. However, they will be running on an unsupported runtime which is no longer maintained or patched by the AWS Lambda team.

Can the team please advise on when this is going to be fixed? You originally decided to dynamically generate this code, making it nearly impossible for your customers to do anything about this issue yourself. That also means you have the responsibility to keep things up to date. In the end, it's your own company deprecating this.

This is a few hours of dev time max. I'm sure your company have that capacity.

@pahud ?

houmark avatar Nov 14 '25 04:11 houmark

Hi @houmark

I just escalated this issue to P1. I’ll bring it up with the team tomorrow to make sure it’s addressed promptly.

pahud avatar Nov 14 '25 05:11 pahud

The PR has been merged https://github.com/aws-amplify/amplify-category-api/pull/3338 https://github.com/aws-amplify/amplify-category-api/pull/3340

I will request internally if there's any timelines we can share for the next release.

pahud avatar Nov 18 '25 16:11 pahud

There was a CLI release just now, but I am unsure if this made it in. From what I can see, it did not, but your release notes and changelogs are and have always been a mess to be honest.

houmark avatar Nov 20 '25 21:11 houmark

Yes, today's CLI release should include PR 3340.

svidgen avatar Nov 20 '25 22:11 svidgen

@svidgen I just did an amplify push on command line and while the function "updated" (see screenshot, I pushed for the dev env) and got a new timestamp, it is still running on Python v3.9 and the source code inside the function is exactly the same.

Any special instructions one need to follow to actually get a later version or did this maybe not release after all?

Image

Latest Amplify version: Image

houmark avatar Nov 20 '25 23:11 houmark

That is surprising in a number of ways, actually. We'll have to dig on this.

@houmark ~~Has this function always been running 3.9 for you by default? No manual overrides on your side? (The prior python upgrade actually only brought it to 3.8!)~~

Looks like we just missed a code path. We'll work on getting that updated.

svidgen avatar Nov 21 '25 15:11 svidgen

@svidgen Sorry, I saw this comment when I was out and forgot to reply when I got back. Just remembered now.

To answer you question. No, there are no overrides related to this. I have other overrides in the system, but I believe you cannot even override this part which is why an update by your team is needed.

I see in the PR you did after your comment, the Python runtime is changed to v3.12, but in the prior commit I did not see the generated code or any changes to it. When I originally reported this, I believe I did some quick test in Lambda where I changed the version to 3.12 on the existing codebase deployed just to see if that worked, but there was major API changes for the later Python versions making the old code not work with the new Python version.

Is that addressed in this and the prior update? Considering that the latest release/update seemed to have not been tested by a human (who would have noticed that the Python version did not change in seconds) I am now concerned if the runtime is updated to v3.12 but the code is then broken which will break our entire platform because DynamoDB data will stop synchronizing to ElasticSearch.

I don't feel like being the test-rabbit on this one, so can someone on the AWS Amplify team confirm that this will be tested to actually work and that the Python script will continue to actually sync data as is expected?

houmark avatar Nov 27 '25 01:11 houmark

@svidgen @pahud any info on when this will release? We are now 7 days away from AWS EOL of Python 3.9.

houmark avatar Dec 09 '25 04:12 houmark

AFAIK we are actively working on this. I'll connect with @svidgen for inputs.

pahud avatar Dec 09 '25 15:12 pahud