Manage AWS Credentials
How to install?
npm i manage-aws-credentials
How to use?
Load profiles from an existing file
const AWSCredentials = ;AWSCredentials;
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 text
As a Object
const AWSCredentials = ;AWSCredentials;
As a Text
const AWSCredentials = ;AWSCredentials;
Add a new profile
const AWSCredentials = ;AWSCredentials;
NOTE: The profile name needs to accomplish the next regex ^([A-Za-z0-9-]+)(([A-Za-z0-9-]+)?)+$ (number and letters separated by dashes)
Accepted Options
Option | Config Entry | Type | Default |
---|---|---|---|
access_key | aws_access_key_id | String | null |
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 | Path |
parameter_validation | parameter_validation | Boolean | true |
tcp_keepalive | tcp_keepalive | Boolean | true |
max_attempts | max_attempts | Number | null |
retry_mode | retry_mode | String | null |
Edit a existing profile
const AWSCredentials = ;AWSCredentials;
NOTE: The new profile name needs to accomplish the next regex ^([A-Za-z0-9-]+)(([A-Za-z0-9-]+)?)+$ (number and letters separated by dashes)
Accepted Options
Option | Config Entry | Type | Default |
---|---|---|---|
access_key | aws_access_key_id | String | null |
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 | Path |
parameter_validation | parameter_validation | Boolean | true |
tcp_keepalive | tcp_keepalive | Boolean | true |
max_attempts | max_attempts | Number | null |
retry_mode | retry_mode | String | null |
new_name | String | null |
Switch to an existing profile
const AWSCredentials = ;AWSCredentials;
Remove a profile
const AWSCredentials = ;AWSCredentials;
Save the current profiles to the aws file
const AWSCredentials = ;AWSCredentials;
NOTE: Be careful with this action, the method overwrite the default AWS profiles file with the loaded profiles.
Import JSON profile file
const AWSCredentials = ;AWSCredentials;
NOTE: The JSON file to import needs to satisfy the package serialization
Export JSON profile file
const AWSCredentials = ;AWSCredentials;