Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamaz/dotenv-aws-mfa
Helps to maintain aws token in dotenv file
https://github.com/kamaz/dotenv-aws-mfa
aws dotenv mfa
Last synced: about 1 month ago
JSON representation
Helps to maintain aws token in dotenv file
- Host: GitHub
- URL: https://github.com/kamaz/dotenv-aws-mfa
- Owner: kamaz
- Created: 2020-01-16T19:55:51.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T05:17:31.000Z (almost 2 years ago)
- Last Synced: 2024-09-29T18:02:36.721Z (3 months ago)
- Topics: aws, dotenv, mfa
- Language: TypeScript
- Size: 1.86 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Why
Because switching between AWS credentials is annoying with mfa.
## Status
Still beta
## Prerequisite
Before using the script you have to have aws access key and secret key present in `~/.aws/credentials`
## How
1. Install [direnv](https://direnv.net/) or a clone but I've only tested in `direnv`.
2. Create a `.envrc` file in your project with following configuration:
```bash
# .envrc
dotenv
```It is safe to check-in to repository.
3. Add an empty `.env` file
4. First use
```bash
dotenv-aws-mfa
```5. Once `.envrc` is reloaded you can just use
```bash
dotenv-aws-mfa -t
```## Something is not right
```bash
DEBUG=dotenv-aws-mfa dotenv-aws-mfa -t
```## Under the hood
### Environment variables
| Name | Description |
| ----------- | ------------------------------------- |
| DAM_USER | your AWS login username |
| DAM_ACCOUNT | your AWS account number |
| DAM_PROFILE | profile configured in AWS credentials |
| DAM_ROLE | a role |### Order of precedence
1. Environment variables
2. Arguments
3. Interactive command line## Fancy contribute
To install locally just run:
```bash
yarn build; yarn global add $(pwd)
dotenv-aws-mfa
```