aws-amplify / aws-amplify/amplify-cli

Auth Import - Custom SMS/EMAIL Message Values Not Imported

Open
#8,842 0 comments 0 reactions 0 assignees View on GitHub
auth bug import p3
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/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### How did you install the Amplify CLI?

npm

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

14.17.3

### Amplify CLI Version

6.4.0

### What operating system are you using?

Windows

### Amplify Categories

auth

### Amplify Commands

Not applicable

### Describe the bug

Messages customization are not pulled from Cognito Pool.

"smsAuthenticationMessage": "Your authentication code is {####}",
"smsVerificationMessage": "Your verification code is {####}",
"emailVerificationSubject": "Your verification code",
"emailVerificationMessage": "Your verification code is {####}"

### Expected behavior

When executing the command "import auth"

The following files:

amplify \ backend \ amplify-meta.json
amplify \ backend \ auth \ \ parameters.json

Should have the following lines appended/imported from the Pool:

"smsAuthenticationMessage": "Your authentication code is {####}",
"smsVerificationMessage": "Your verification code is {####}",
"emailVerificationSubject": "Your verification code",
"emailVerificationMessage": "Your verification code is {####}"

### Reproduction steps

Requirement:

Have a cognito user pool with MFA account verification through SMS/EMAIL.

Run the command "amplify import auth" then "amplify push".

You will see a message that modelgen failed.
In the Admin UI if you try to deploy your data models it will fail with the following issue:

ValidationException - An error occurred while processing your request: Email Verification Subject and Message are required if the delivery method is set to email
ValidationException - An error occurred while processing your request: An SMS authentication message is required if MFA is enabled

### GraphQL schema(s)

N/A

### Log output

```

Failed to create models in the cloud: Modelgen job creation failed

ValidationException - An error occurred while processing your request: Email Verification Subject and Message are required if the delivery method is set to email
ValidationException - An error occurred while processing your request: An SMS authentication message is required if MFA is enabled

```

### Additional information

Resolved by unlinking the pool, re-importing & adding the SMS/Email custom message BEFORE "amplify push"

Contributor guide

Open the contributing guide

Research direction

Start with the import auth flow and the generated amplify/backend/amplify-meta.json and amplify/backend/auth//parameters.json files. Reproduce with amplify import auth followed by amplify push, then trace why the Cognito SMS and email message values are omitted. Done means the values are retained after import and amplify push no longer fails validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
authentication, backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.