aws-amplify / aws-amplify/amplify-cli

Amplify push doesn't recognize functions environment variables changes

Open
#13,323 3 comments 1 reaction 0 assignees View on GitHub
bug functions p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

npm

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

v18.17.1

### Amplify CLI Version

12.6.0

### What operating system are you using?

Ubuntu

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

No manual changes made

### Describe the bug

`$ amplify function update`

```
? Which setting do you want to update? Environment variables configuration
? Select what you want to do with environment variables: Update existing environment variables
? Which environment variable do you want to update: MY_TABLE
? Enter the environment variable name: MY_TABLE
? Enter the environment variable value: tablenamehere
? Select what you want to do with environment variables: I'm done
? Do you want to edit the local lambda function now? N
```

`$ git status` shows
```
modified: amplify/team-provider-info.json
```

`$ amplify function push --force` shows `No Change`

The variable is not updated in AWS Lambda function.

### Expected behavior

I'm expecting that changing a function environment variable can be _pushable_, at least with `amplify function push --force`.

### Reproduction steps

1. create a function with an environment variable with a wrong value
2. run `$ amplify function update` to change the variable value
3. try to push the function with `amplify push function --force`

### Project Identifier

_No response_

### Log output

_No response_

### 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.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the flow with `amplify function update` followed by `amplify function push --force` on Ubuntu with Amplify CLI 12.6.0 and inspect the changed `amplify/team-provider-info.json`. Trace the CLI entry points for function environment-variable updates and the force-push change check. Done means the changed variable is recognized and updated in the AWS Lambda function instead of reporting `No Change`.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, typescript
Domain
backend, cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.