aws-amplify / aws-amplify/amplify-cli
How to repair UserPool drift caused by #9525
- 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?
v14.18.1
### Amplify CLI Version
7.6.8
### 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
auth
### Amplify Commands
push
### Describe the bug
Hello!
My prod userpool was affected by this bug:
https://github.com/aws-amplify/amplify-cli/issues/9525#issuecomment-1017668783
Essentially, I had setup that I duplicated into a new amplify env prod. This prod userpool was created with only 1 of the required attributes from my repo.
I pushed with:
```
"requiredAttributes": [
"email",
"family_name",
"given_name",
"picture"
],
```
But the userpool was only created with "picture" as a required attribute. This has blocked us from upgrading the CLI, and I thought that I could get away with just upgrading the attributes to only include picture (Since that's what was going on in prod the whole time anyway).
So I changed cli-inputs.json to have:
```
"requiredAttributes": [
"picture"
],
```
This seems to have fixed our production pipeline on latest CLI as we are able to push to prod with latest CLI version.
However, now the repo doesn't match the rest of the environments we've created (sandboxes, internal, etc.) as they all have the 4 required attributes, and attempting to push gets this error:
Cognito configuration in the cloud has drifted from local configuration. Present changes cannot be pushed until drift is fixed. `requiredAttributes` requested is ["picture"], but ["email","family_name","given_name","picture"] is required by Cognito configuration. Update /Users/artdiniz/workspace/ruso/amplify/backend/auth/lighthall/cli-inputs.json to continue.
How can we get around this?
### Expected behavior
Would love to be able to consolidate this issue either by removing attributes across the board or being able to have consistency between repo and all the userpools. It's our production userpool so we need to keep the user data and all.
### Reproduction steps
Create 1st userpool and push it
Grab version https://github.com/aws-amplify/amplify-cli/issues/9525#issuecomment-1017668783
Create new amplify env and push, creating 2nd userpool with drift
Upgrade CLI, now unable to push
### GraphQL schema(s)
```graphql
# Put schemas below this line
```
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.