aws-amplify / aws-amplify/amplify-cli
invalid auth override file causes `amplify update auth` to error with stack trace
- 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.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 added a custom attribute
### Describe the bug
When attempting to configure a Lambda trigger for a Cognito User Pool using the Amplify CLI, the process encounters an error, preventing successful configuration. The issue occurs during the configuration of a "Post Confirmation" trigger when selecting the option to "Create your own module."
### Expected behavior
The Amplify CLI should successfully add a Lambda trigger for the Post Confirmation event in the Cognito User Pool without any errors.
### Reproduction steps
1. Run the amplify auth update command.
2. Follow the on-screen prompts to configure authentication settings.
3. When asked, "Do you want to configure Lambda Triggers for Cognito?" choose "Yes."
4. Select "Post Confirmation" as the trigger type.
5. Choose "Create your own module" as the method to create the Lambda trigger.
### Project Identifier
_No response_
### Log output
```
Error: InvalidOverrideError: Executing overrides failed.
at generateUserPoolGroupStackTemplate (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/utils/generate-user-pool-group-stack-template.js:11:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async updateUserPoolGroups (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/utils/synthesize-resources.js:224:9)
at async /snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/handlers/resource-handlers.js:66:9
at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/commands/auth/update.js:94:40)
at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/index.js:347:5)
at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)
🛑 There was an error adding the auth resource
```
### 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
Research direction
Reproduce the flow with `amplify auth update`, selecting a Post Confirmation Cognito trigger and "Create your own module." Start by reading `generate-user-pool-group-stack-template.js`, then follow its callers in `synthesize-resources.js` and `resource-handlers.js`; done means the invalid override is handled without a stack trace and the Lambda trigger can be configured successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- authentication, backend, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100