aws-amplify / aws-amplify/amplify-cli

Empty Python lambda size is 3.4MB and in-line code editing on the Lambda console is impossible.

Open
#9,919 19 comments 5 reactions 0 assignees View on GitHub
feature-request functions p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [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.

### How did you install the Amplify CLI?

npm

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

_No response_

### Amplify CLI Version

7.2.2 latest

### What operating system are you using?

Amazon Linux, Cloud9

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

No manual changes made.

### Amplify Categories

function

### Amplify Commands

add

### Describe the bug

Whenever I create a new Python lambda function and do an amplify push, the size of the lambda function is always over 3MB, usually 3.4MB. This disallows me to do code editing and testing in the lambda console which I am used to doing as we use Amplify with appsync and deploy lambda functions through Amplify. This occurs even when I create a blank default lambda function in python without any code changes or modifications to the default.

### Expected behavior

I should be able to make code edits and test on the lambda console because the size is usually under 3MB.

### Reproduction steps

1. amplify add function
2. Select python function
3. Make no changes and accept defaults
4. amplify push
5. Check lambda console and you get the message: The deployment package of your Lambda function "testfunc-dev" is too large to enable inline code editing. However, you can still invoke your function.

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with `amplify add function` and `amplify push` using a blank Python function, then trace the Amplify CLI's function packaging path. Done means the unchanged deployment package is below the Lambda console's inline-editing limit and the reported reproduction steps no longer produce the size warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python, typescript
Domain
backend, cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.