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 819 forks source link

Having Social Logins and Notifications cause error on "amplify env add ..." #13823

Closed phaunatechnology closed 2 months ago

phaunatechnology commented 3 months ago

How did you install the Amplify CLI?

npm

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

v20.10.0

Amplify CLI Version

12.12.2

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.

Describe the bug

If an Auth resourced is configured with social auth providers (Google, Facebook, Apple, etc.) and also has push notifications configured (my case is APNS), running "amplify env add ..." will result in an error shown in the following error message:

πŸ›‘ Channel APNS: Auth and Pinpoint resources deployment failed with Error PushResourcesFault: Failed to create Pinpoint resource for the given environment: This environment is missing some parameter values.
βœ– There was an error initializing your environment.
πŸ›‘ Failed to create Pinpoint resource for the given environment: This environment is missing some parameter values.

The new backend environment will be created, but none of the resources will be created and deployed. Attempting to run "amplify push" results in the more verbose error message of:

πŸ›‘ The following resources failed to deploy:
Resource Name: auth (AWS::CloudFormation::Stack)
Event Type: create
Reason: Template format error: Unresolved resource dependencies [facebookAppId, appleAppId, googleClientId] in the Resources block of the template

Without push notifications added, running "amplify env add ..." will create the new environment and the CLI will request the appropriate IDs and keys for the social provider logins. With push notifications added, it does not request this information, which I suspect is the root cause of the bug.

Expected behavior

After running "amplify env add ..." I expected to have a new environment that duplicated the environment I started on without any errors. This new environment should request all the appropriate IDs and Keys for my social login providers.

Reproduction steps

  1. Add auth with social providers.
  2. Add push notifications (My case used APNS)
  3. Run "Amplify env add ENV_NAME" where ENV_NAME is a new environment name.
  4. Should see the described bug.

Project Identifier

No response

Log output

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

Additional information

No response

Before submitting, please confirm:

ykethan commented 3 months ago

Hey @phaunatechnology, thank you for reaching out. This behavior is currently being tracked on https://github.com/aws-amplify/amplify-cli/issues/13501 Workaround: run amplify update auth -> select Update OAuth social providers, updating the identity providers and push mitigates the issue. Could you let us know if does fix the issue.

ykethan commented 2 months ago

Closing the issue due to inactivity. Do reach out to us if you are still experiencing this issue

github-actions[bot] commented 2 months ago

This issue is now closed. 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.