Manage AWS Credentials
- How to install
- How to use
How to install?
npm i aws-accounts
How to use?
Auto Save
const awsAccounts = ; // Toggle auto save option, default value falseawsAccounts; // The profile will be automatically saved on the credentials fileawsAccounts;
Chainable methods
This module permits some methods to be chainable to use in the next way:
const awsAccounts = ; // Add profile and save on one lineawsAccounts;
insetad of
const awsAccounts = ; // Add profileawsAccounts // Save changesawsAccounts;
Allowed methods
Method |
---|
addProfile |
editProfile |
deleteProfile |
switchProfile |
importCredentials |
toggleAutoSave |
Load profiles from an existing file
const awsAccounts = ;awsAccounts;
Note: By the fault the package load the profiles from the default file see https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html
Get profiles serialized
Note: By default the profiles are serialized as a JSON/OBJECT
As a JSON
const awsAccouts = ;awsAccouts;
As a Text
const awsAccouts = ;awsAccouts;
Add a new profile
const awsAccounts = ;awsAccounts;
see Accepted Options
Edit a existing profile
const awsAccounts = ;awsAccounts;
see Accepted Options
Switch to an existing profile
const awsAccounts = ;awsAccounts;
Remove a profile
const awsAccounts = ;awsAccounts;
Save the current profiles to the aws file
const awsAccounts = ;awsAccounts;
NOTE: Be careful with this action, the method overwrite the default AWS profiles file with the loaded profiles.
Import JSON profile file
const awsAccounts = ;awsAccounts;
NOTE: The JSON file to import needs to satisfy the package serialization
Export JSON profile file
const awsAccounts = ;awsAccounts;
Accepted Options
Option | Config Entry | Type | Default |
---|---|---|---|
name | [name] | String | null |
aws_access_key_id | aws_access_key_id | String | null |
aws_secret_access_key | aws_secret_access_key | String | null |
region | region | String | null |
output | output | String | json |
cli_timestamp_format | cli_timestamp_format | String | wire |
cli_follow_urlparam | cli_follow_urlparam | Boolean | true |
ca_bundle | ca_bundle | String | null |
parameter_validation | parameter_validation | Boolean | true |
tcp_keepalive | tcp_keepalive | Boolean | true |
max_attempts | max_attempts | Number | null |
retry_mode | retry_mode | String | null |