aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Empty trigger key in auth cli-inputs.json #13081

Closed pmm4654 closed 1 year ago

pmm4654 commented 1 year ago

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v19.8.1

Amplify CLI Version

12.2.3

What operating system are you using?

Ubuntu

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

When attempting to update auth via amplify update auth so that I can add a custom pre signup trigger. When I get past all of the other questions I have no lambdas generated and an empty object in my auth/<app>/cli-inputs.json

Expected behavior

I expected my backend/functions directory to have newly generated lambdas for pre signup (and any others selected) so that I could modify them. I also expected my cli-inputs.json file to have a triggers key that was populated with the specific triggers I needed.

Reproduction steps

 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
 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 cont
ent, Analytics, and more)
 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
 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 reg
istration)
 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
 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? Yes
 What domain name prefix do you want to use? 8cutvxmcavzx
 Which redirect signin URIs do you want to edit?
 Do you want to add redirect signin URIs? No
 Which redirect signout URIs do you want to edit?
 Do you want to add redirect signout URIs? No
 Select the OAuth flows enabled for this project. Authorization code grant
 Select the OAuth scopes enabled for this project. Phone, Email, OpenID, Profile, aws.cognito
.signin.user.admin
 Select the identity providers you want to configure for your user pool: Facebook, Google

 You've opted to allow users to authenticate via Facebook.  If you haven't already, you'll ne
ed to go to https://developers.facebook.com and create an App ID.

 Enter your Facebook App ID for your OAuth flow:  asfd
 Enter your Facebook App Secret for your OAuth flow:  asdf

 You've opted to allow users to authenticate via Google.  If you haven't already, you'll need
 to go to https://developers.google.com/identity and create an App ID.

 Enter your Google Web Client ID for your OAuth flow:  asdf
 Enter your Google Web Client Secret for your OAuth flow:  asdf
? Do you want to configure Lambda Triggers for Cognito? Yes
? Which triggers do you want to enable for Cognito Post Authentication, Post Confirmation, Pr
e Authentication, Pre Sign-up
? What functionality do you want to use for Post Authentication
? What functionality do you want to use for Post Confirmation
? What functionality do you want to use for Pre Authentication
? What functionality do you want to use for Pre Sign-up
✅ Successfully updated auth resource parcomvp0a14dc54 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

✅ 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

Project Identifier

5cae6e16e5065d2f34d6efe95b678b09

Log output

``` # Put your logs below this line No relevant logs ```

Additional information

No response

Before submitting, please confirm:

josefaidt commented 1 year ago

Hey @pmm4654 :wave: thanks for raising this! Looking at the pasted CLI output it looks as if the triggers were "enabled", but a functionality was not chosen

? Which triggers do you want to enable for Cognito Post Authentication, Post Confirmation, Pr
e Authentication, Pre Sign-up
? What functionality do you want to use for Post Authentication
? What functionality do you want to use for Post Confirmation
? What functionality do you want to use for Pre Authentication
? What functionality do you want to use for Pre Sign-up

Can you confirm whether choosing a "functionality" adds the Functions to your project?

pmm4654 commented 1 year ago

I had selected "Create your own module". I retried these steps today and it now seems like the module is actually being created when it wasn't before. The only thing that changed was a complete restart of the computer. Hopefully this continues to work as expected - thanks for the reply @josefaidt

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.