aws-amplify / aws-amplify/amplify-cli
Deleting environment variables for Lambda function in one environment causes `amplify push` to fail in another environment
- 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/dev/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?
v14.21.1
### Amplify CLI Version
10.5.1
### What operating system are you using?
Mac
### 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
push, update
### Describe the bug
Deleting environment variables for Lambda function in one environment causes `amplify push` to fail in another environment.
### Expected behavior
`amplify push` should not fail.
### Reproduction steps
1. `amplify init -y`
2. `amplify add env` [create an environment named "prod"]
3. `amplify add function` [create a lambda function with an environment variable]
4. `amplify push`
5. `amplify env checkout dev`
6. `amplify push`
7. `amplify update function` [delete the environment variable]
8. `amplify push`
9. `amplify env checkout prod`
10. `amplify push`
`amplify push` fails with this error message:
> 🛑 The following resources failed to deploy:
> 🛑 Resource is not in the state stackUpdateComplete
### GraphQL schema(s)
```graphql
# Put schemas below this line
```
### Project Identifier
_No response_
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.