aws-amplify / aws-amplify/amplify-cli
Local changes to Admin Query lambda function is overwritten when 'amplify update auth' is run
- 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.
I made a change to the Lambda function in app.js under the directory for the Admin Queries API function.
### Amplify Categories
auth
### Amplify Commands
update
### Describe the bug
Amplify auth update' resets the modified function code used by auth module amplify/backend/function/AdminQueriesXXX/src.
### Expected behavior
The modified function code should not be reset.
### Reproduction steps
1. Init Amplify project.
2. Add auth with admin queries as per the documentation
3. Change code of the function 'amplify/backend/function/AdminQueriesXXX/src'.
4. update api -> 'amplify update auth'
5. Change the auth parameters e.g. add user pool groups.
6. Local code of the function is rewritten with template code. check 'amplify/backend/function/AdminQueriesXXX/src' to confirm that previous code changes are reset.
### 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
Research direction
Start by reproducing the documented sequence with amplify/backend/function/AdminQueriesXXX/src: edit app.js, run amplify update auth, and compare the local function code before and after the update. Trace the auth update and Admin Queries template generation paths to identify why the existing code is replaced; done means local changes remain intact after changing auth parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- authentication, backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100