Closed mybluedog24 closed 2 years ago
Hi @mybluedog24 👋 thanks for raising this issue. It looks like this issue has more to do with the Amplify CLI than the JS library so I am transferring this over to the CLI repo for better support and feedback.
In the meantime, if you are able to reproduce this consistently on your end, can you please list some reproduction steps that led up to this error like how did you configure your auth resource, what other resources did you add if any, etc?
I would also suggest looking through similar issues, such as this one https://github.com/aws-amplify/amplify-cli/issues/3149, where other developers ran into a similar problem. Some possible solutions may include upgrading the Amplify CLI version to the latest and attempting to push again.
Hey @mybluedog24 :wave: to add on to @chrisbonifacio 's comment above, if you run amplify update auth
does it prompt you to migrate the resource? If so, this should not only migrate your resource to use the latest structure, but also regenerate the CloudFormation template which should update this Lambda runtime version
Hey @mybluedog24 👋 to add on to @chrisbonifacio 's comment above, if you run
amplify update auth
does it prompt you to migrate the resource? If so, this should not only migrate your resource to use the latest structure, but also regenerate the CloudFormation template which should update this Lambda runtime version
Thank you for your response. I tried but it gives another error:
The following resource(s) failed to update: [UserPool].
Updates are not allowed for property - UsernameAttributes. (Service: AWSCognitoIdentityProvider; Status Code: 400; Error
Code: InvalidParameterException; Request ID: null; Proxy: null)
I didn't update anything, just added a user pool group to trigger the update:
A migration is needed to support latest updates on auth resources.
Recommended to try in a non-production environment first. Run "amplify env add" to create or clone an environment.
Custom CloudFormation changes will NOT be preserved. Custom changes can be made with "amplify auth override" after migration.
Learn more about this migration: https://docs.amplify.aws/cli/migration/override
Do you want to migrate auth resource "xxxxxxxx"? (Y/n) · yes
Using service: Cognito, provided by: awscloudformation
What do you want to do? Create or update Cognito user pool groups
? Provide a name for your user pool group: dummygroup
? Do you want to add another User Pool Group No
√ Sort the user pool groups in order of preference · dummygroup
I finally made it work. By checking my notes, Amplify cli can't set email as username before. So I manually added UsernameAttributes: - 'email'
to the template yaml file when I first time created the project. And after adding this to new template files, it works:
// add below to "Parameters" in auth/xxxxxxx/build/xxxxxxx-cloudformation-template.json
"usernameAttributes": {
"Type": "CommaDelimitedList"
},
// add below to auth/xxxxxxx/build/parameters.json
"usernameAttributes": [
"email"
],
// add below to cli-input.json
"usernameAttributes": [
"email"
],
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
I was updating an old project which still contained nodejs6.10, nodejs8.10, nodejs10.x. I finally got it work and run
amplify push
successfully, but when checking on CloudFormation, it's still at statusUPDATE_ROLLBACK_COMPLETE
. By checking the stack it'sUserPoolClientLambda
in the auth stack throws error:But all my template files and lambda functions are already nodejs14.x. I can't find anywhere that contains runtime nodejs6.10 in my files or functions.
Any help would be appreciated, thanks!
Expected behavior
Expected update stack successfully.
Reproduction steps
No this error when creating new project.
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response