I recently updated to 12.10.1 (probably from 12.10 but possible from 12.9.0, not sure)
And now my amplify push failed with some errors about analytics and pinpoint although I didn't touch them since last successful build and they are not mentioned in updated resources amplify output on amplify push
But that's aside I don't understand why could amplify update auth
start to ignore an existing auth resource and try to create a new one?
Here are some of my attempt interaction logs:
amplify update auth
Please note that certain attributes may not be overwritten if you choose to use defaults settings.
You have configured resources that might depend on this Cognito resource. Updating this Cognito resource could have unintended side effects.
Using service: Cognito, provided by: awscloudformation
The current configured provider is Amazon Cognito.
Do you want to use the default authentication and security configuration? Manual configuration
What do you want to do? Walkthrough all the auth configurations
Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
Provide a friendly name for your resource that will be used to label this category in the project: xxxx
Enter a name for your identity pool. xxxx
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) No
Do you want to enable 3rd party authentication providers in your identity pool? No
Provide a name for your user pool: xxxx
Warning: you will not be able to edit these selections.
How do you want users to be able to sign in? Email
Do you want to add User Pool Groups? No
Do you want to add an admin queries API? No
Multifactor authentication (MFA) user login options: OFF
Email based user registration/forgot password: Enabled (Requires per-user email entry at registration)
Specify an email verification subject: Your verification code
Specify an email verification message: Your verification code is {####}
Do you want to override the default password policy for this User Pool? No
Warning: you will not be able to edit these selections.
What attributes are required for signing up? Email
Specify the app's refresh token expiration period (in days): 30
Do you want to specify the user attributes this app can read and write? Yes
Specify read attributes: Email
Specify write attributes: Name, Phone Number, Picture, Profile
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow? No
? Do you want to configure Lambda Triggers for Cognito? Yes
? Which triggers do you want to enable for Cognito Post Confirmation, Pre Sign-up
? What functionality do you want to use for Post Confirmation
? What functionality do you want to use for Pre Sign-up
Error: Data did not validate against the supplied schema. Underlying errors were [
{
"keyword": "type",
"dataPath": ".cognitoConfig.usernameAttributes",
"schemaPath": "#/definitions/ServiceQuestionsBaseResult/properties/usernameAttributes/type",
"params": {
"type": "array"
},
"message": "should be array"
}
]
at CLIInputSchemaValidator.validateInput (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/category-interfaces/category-base-schema-generator.js:121:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AuthInputState.saveCLIInputPayload (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/auth-inputs-manager/auth-input-state.js:79:13)
at async /snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/handlers/resource-handlers.js:116: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 updating the auth resource
✅ Successfully updated resource update locally
✅ Some next steps:
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud
amplify update auth
Please note that certain attributes may not be overwritten if you choose to use defaults settings.
You have configured resources that might depend on this Cognito resource. Updating this Cognito resource could have unintended side effects.
Using service: Cognito, provided by: awscloudformation
The current configured provider is Amazon Cognito.
Do you want to use the default authentication and security configuration? Default configuration
What do you want to do? Walkthrough all the auth configurations
Select the authentication/authorization services that you want to use: User Sign-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage features for images or other content, Analytics, and more)
Provide a friendly name for your resource that will be used to label this category in the project: xxxx
Enter a name for your identity pool. xxxx
Allow unauthenticated logins? (Provides scoped down permissions that you can control via AWS IAM) No
Do you want to enable 3rd party authentication providers in your identity pool? No
Provide a name for your user pool: xxxx
Warning: you will not be able to edit these selections.
How do you want users to be able to sign in? Email
Do you want to add User Pool Groups? No
Do you want to add an admin queries API? No
Multifactor authentication (MFA) user login options: OFF
Email based user registration/forgot password: Enabled (Requires per-user email entry at registration)
Specify an email verification subject: Your verification code
Specify an email verification message: Your verification code is {####}
Do you want to override the default password policy for this User Pool? No
Warning: you will not be able to edit these selections.
What attributes are required for signing up? Email
Specify the app's refresh token expiration period (in days): 30
Do you want to specify the user attributes this app can read and write? No
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow? No
? Do you want to configure Lambda Triggers for Cognito? Yes
? Which triggers do you want to enable for Cognito Post Confirmation, Pre Sign-up
? What functionality do you want to use for Post Confirmation
? What functionality do you want to use for Pre Sign-up Create your own module
Error: jsmtext07f0aa1aPreSignup is present in amplify-meta.json
at AmplifyToolkit.updateamplifyMetaAfterResourceAdd (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/update-amplify-meta.js:131:15)
at createFunctionResources (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/provider-utils/awscloudformation/utils/storeResources.js:47:21)
at addFunctionResource (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/provider-utils/awscloudformation/index.js:88:56)
at Object.addResource (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/provider-utils/awscloudformation/index.js:51:20)
at add (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-function/lib/index.js:85:31)
at AmplifyToolkit.invokePluginMethod (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/invoke-plugin-method.js:44:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AmplifyToolkit.addTrigger (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/trigger-flow.js:59:5)
at async handleTriggers (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/utils/trigger-flow-auth-helper.js:64:35)
at async lambdaTriggers (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/utils/synthesize-resources.js:119:32)
at async getResourceUpdater (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/utils/synthesize-resources.js:57:5)
at async /snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-category-auth/lib/provider-utils/awscloudformation/handlers/resource-handlers.js:105:5
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
It may not be obvious from the logs, but the interactive cli didn't highlight already bound cognito triggers and suggested a new auth resource names and new cognito pool and identity provider names