aws-amplify / aws-amplify/amplify-cli

unexpected `OAuthCustomResourceInputs` error on push after updating unrelated resource

Open
#11,495 1 comment 2 reactions 0 assignees View on GitHub
auth bug p2 regression
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### 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. (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
at Request. (/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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.