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

unexpected `OAuthCustomResourceInputs` error on push after updating unrelated resource #11495

Open josefaidt opened 1 year ago

josefaidt commented 1 year ago

Before opening, please confirm:

How did you install the Amplify CLI?

pnpm

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

18

Amplify CLI Version

10.5.1

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.

n/a

Amplify Categories

auth

Amplify Commands

Not applicable

Describe the bug

As I was using a project to reproduce this exact issue I was initially unsuccessful, however after coming back to the project and making updates to unrelated resources (like adding a new function) I am presented with this error:

🛑 The following resources failed to deploy:
Resource Name: OAuthCustomResourceInputs (Custom::LambdaCallout)
Event Type: create
Reason: Received response status [FAILED] from custom resource. Message returned: See the details in CloudWatch Log Stream: 2022/11/29/[$LATEST]c86010aa8fe0497c875afa39324c7f39 (RequestId: 434f8e76-e11f-4f7d-ac50-6d015663b425)

In CloudWatch I see the following:

2022-11-23T17:24:50.862Z    b5562efd-a55f-403f-b1c5-ea603a59560c    INFO    {
  UserPoolId: 'us-east-1_dpwM86ARD',
  AllowedOAuthFlows: [ 'code' ],
  AllowedOAuthFlowsUserPoolClient: true,
  AllowedOAuthScopes: [
    'phone',
    'email',
    'openid',
    'profile',
    'aws.cognito.signin.user.admin'
  ],
  CallbackURLs: [ 'http://localhost:3000/' ],
  LogoutURLs: [ 'http://localhost:3000/' ],
  SupportedIdentityProviders: [ 'Facebook', 'Google', 'COGNITO' ]
}

2022-11-23T17:24:51.885Z    b5562efd-a55f-403f-b1c5-ea603a59560c    INFO    InvalidParameterException: The provider Facebook does not exist for User Pool us-east-1_dpwM86ARD.
    at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)
    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:686:14)
    at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:688:12)
    at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18)

This is the exact behavior as shown in an older bug https://github.com/aws-amplify/amplify-cli/issues/7388#issuecomment-994126629

Workaround

  1. amplify update auth
  2. update OAuth Social Providers
  3. re-input secrets (NOTE: the values are not pre-filled from before)

Expected behavior

n/a

Reproduction steps

  1. amplify init -y
  2. amplify add auth > Add social providers, provide fake values for OAuth
  3. amplify push -y
  4. observe push is successful
  5. do something else, amplify add function
  6. amplify push -y
  7. observe error

GraphQL schema(s)

```graphql # Put schemas below this line ```

Project Identifier

No response

Log output

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

Additional information

No response

behaviary commented 1 year ago

Is this still a problem? It seems like I'm running into this now.