1.7.0 • Published 4 years ago

manage-aws-credentials v1.7.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Manage AWS Credentials

GitHub license GitHub stars Version npm

How to install?

npm i manage-aws-credentials

How to use?

Load profiles from an existing file

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.deserialize_credentials('./path/to/the/file');

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 = require('manage-aws-credentials');

AWSCredentials.serialize_credentials('object');

As a Text

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.serialize_credentials('text');

Add a new profile

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.add_profile('PROFILE-NAME', options);

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

OptionConfig EntryTypeDefault
access_keyaws_access_key_idStringnull
secret_access_keyaws_secret_access_keyStringnull
regionregionStringnull
outputoutputStringjson
cli_timestamp_formatcli_timestamp_formatStringwire
cli_follow_urlparamcli_follow_urlparamBooleantrue
ca_bundleca_bundleStringPathnull
parameter_validationparameter_validationBooleantrue
tcp_keepalivetcp_keepaliveBooleantrue
max_attemptsmax_attemptsNumbernull
retry_moderetry_modeStringnull

Edit a existing profile

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.edit_profile('PROFILE-NAME', options);

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

OptionConfig EntryTypeDefault
access_keyaws_access_key_idStringnull
secret_access_keyaws_secret_access_keyStringnull
regionregionStringnull
outputoutputStringjson
cli_timestamp_formatcli_timestamp_formatStringwire
cli_follow_urlparamcli_follow_urlparamBooleantrue
ca_bundleca_bundleStringPathnull
parameter_validationparameter_validationBooleantrue
tcp_keepalivetcp_keepaliveBooleantrue
max_attemptsmax_attemptsNumbernull
retry_moderetry_modeStringnull
new_nameStringnull

Switch to an existing profile

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.switch_profile('NAME');

Remove a profile

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.delete_profile('NAME');

Save the current profiles to the aws file

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.save_file();

NOTE: Be careful with this action, the method overwrite the default AWS profiles file with the loaded profiles.

Import JSON profile file

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.import_credentials('./path/to/the/file.json');

NOTE: The JSON file to import needs to satisfy the package serialization

Export JSON profile file

const AWSCredentials = require('manage-aws-credentials');

AWSCredentials.export_credentials('./path/to/the/location/');
1.7.0

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago