aws-amplify / aws-amplify/amplify-cli

Allow skipping the AWS CLI profile creation in `configure`

Open
#5,782 2 comments 0 reactions 1 assignee Claimed by @josefaidt View on GitHub
feature-request p4 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**

I'm having many AWS accounts to manage, and therefore already many profiles. For security reasons I have my AWS configuration (`~/.aws` directory) mounted read-only, and I prefer to not have arbitrary tools modify these. Instead _I_ manage the settings, and would just select the correct profile explicitly whenever using any AWS-related tool.

I'm right now following the AWS Amplify tutorial, and the `amplify configure` just did a couple of things I have issues with:
1. It expects to be fed the credentials. Given that this is a new tool (at least for me), and installed from npm without any specific version or anything, I rather not do that.
2. It also expects that it can modify the ~/.aws/credentials (and probably other files), and will crash in half-finished state (probably) when it can't:
~~~~
Enter the access key of the newly created user:
? accessKeyId: ********************
? secretAccessKey: ****************************************
This would update/create the AWS Profile in your local machine
? Profile Name: amplify-tutorial
EROFS: read-only file system, chmod '.../.aws/credentials'
Error: EROFS: read-only file system, chmod '.../.aws/credentials'
at Object.chmodSync (fs.js:1205:3)
at Object.chmodSync (.../modules/nvs/node/12.19.0/x64/lib/node_modules/@aws-amplify/cli/node_modules/graceful-fs/polyfills.js:252:21)
at makeFileOwnerReadWrite (.../modules/nvs/node/12.19.0/x64/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/system-config-manager.js:98:6)
at Object.setProfile (.../modules/nvs/node/12.19.0/x64/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/system-config-manager.js:19:5)
at Object.run (.../modules/nvs/node/12.19.0/x64/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/setup-new-user.js:113:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
~~~~

**Describe the solution you'd like**

1. Minimally: Handle the EROFS, by providing a "skip", or "try again" option.
2. Ideally: Allow me to enter the name of the profile to use instead of walking through creating a user.

Given that the tutorial only says "run this", I would expect the tool to be very clear and safe to use (i.e. be very defensive on error cases, and allow me to handle whatever local world I have).

**Describe alternatives you've considered**

I actually hoped that it would handle the error and provide a "skip" option, or maybe tell me how to restart the process.

Another option could be to provide indication how to run the tool with an existing user account (think `AWS_PROFILE=my-profile amplify configure`; the tool could check with `sts:GetCallerIdentity` if things are fine) -- but I really don't know where else this information wants to be stored now to know whether this is feasible.

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.