aws-amplify / aws-amplify/amplify-cli

Construct the credentials from environment variables

Open
#407 17 comments 34 reactions 0 assignees View on GitHub
feature-request p3 platform-config
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.**
We don't have any IAM users in the AWS accounts in which we run our solutions. We always interact with the AWS accounts with federated users. We are not allowed to store access key ids and secrets outside a vault (we are using macos keychain). For command-line scripts we use [aws-vault](https://github.com/99designs/aws-vault) (see additional context for an example).

**Describe the solution you'd like**
I would like that `amplify cli` constructs the credentials from environment variables just like the regular `aws cli`. This is a generic solution not specific to any tool. A tool like [aws-vault](https://github.com/99designs/aws-vault) generates the necessary environment variables.
```
AWS_REGION=eu-west-1
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
AWS_SESSION_TOKEN=XXX
```

**Describe alternatives you've considered**
There is no workaround that is compliant with our company policies.

**Additional context**
`amplify --version` > `0.1.32`

Running the init command now fails:
```
aws-vault exec solution-profile -- amplify init

? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using react
? Source Directory Path: src
? Distribution Directory Path: build
? Build Command: npm run-script build
? Start Command: npm run-script start
Using default provider awscloudformation

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html

? accessKeyId:
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
```
Note we want to leave the accessKeyId and secretAccessKey empty, because they are provided in environment variables.

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.