Utility to fetch temp AWS credentials & merge into .env file
Last updated 5 months ago by korourke .
Unlicense · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @korourke/awsmfa 
SYNC missed versions from official npm registry.


npm version License: Unlicense

Fetch temporary AWS session credentials for an MFA-protected account, and merge them into local dotenv file (.env).


$ npm i -g @korourke/awsmfa


Your aws credentials file should have at least one profile, configured with an aws_access_key_id and aws_secret_access_key:



Running this script will retrieve session credentials with the passed MFA token/code, then populate the .env file in the current working directory with AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN. If a .env file already exists these values will be merged into the existing file, and all other variables and comments will be preserved.

Basic usage (profile [default]):

$ awsmfa <MFA_CODE>

Usage with other options:

$ awsmfa --profile some.profile --duration-hours 12 <MFA_CODE>

Current Tags

  • 1.0.1                                ...           latest (5 months ago)

2 Versions

  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
Maintainers (1)
Today 2
This Week 2
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |