aws-amplify / aws-amplify/amplify-cli

better error message when default aws credential is not found for amplify init -y

Open
#13,177 2 comments 0 reactions 1 assignee Claimed by @bombguy View on GitHub
feature-request good first issue p4 platform-init
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

_No response_

### Is this related to another service?

_No response_

### Describe the feature you'd like to request

When there are no `default` aws credential defined locally, `amplify init -y` will fail with error message that may confuse the user. Provide better error message.

### Describe the solution you'd like

If the default credential is not found, print out what was expected and was not found.

### Describe alternatives you've considered

There is a workaround for user to proceed without the `-y` flag. But if a new user is following the documentation, they may just copy & paste commands from document and may run into this. CLI output should guide the user into troubleshooting the issue.

### Additional context

```
amplify init -y
Note: It is recommended to run this command from the root of your app directory
The following configuration will be applied:

Project information
| Name: rdsproject
| Environment: dev
| Default editor: Visual Studio Code
| App type: javascript
| Javascript framework: none
| Source Directory Path: src
| Distribution Directory Path: dist
| Build Command: npm run-script build
| Start Command: npm run-script start

Using default provider awscloudformation
🛑 Failed to get profile credentials
Cannot read properties of undefined (reading 'accessKeyId')
```

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change

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.