Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-accounts

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-accounts

Manage your AWS credentials programatically

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Manage AWS Credentials

GitHub license GitHub stars Version npm

How to install?

npm i aws-accounts

How to use?

Auto Save

const { awsAccounts } = require('aws-accounts');

// Toggle auto save option, default value false
awsAccounts.toggleAutoSave();

 // The profile will be automatically saved on the credentials file
awsAccounts.addProfile(options);

Chainable methods

This module permits some methods to be chainable to use in the next way:

const { awsAccounts } = require('aws-accounts');

// Add profile and save on one line
awsAccounts.addProfile(options).saveFile();

insetad of

const { awsAccounts } = require('aws-accounts');

// Add profile
awsAccounts.addProfile(options)

// Save changes
awsAccounts.saveFile();
Allowed methods
Method
addProfile
editProfile
deleteProfile
switchProfile
importCredentials
toggleAutoSave

Load profiles from an existing file

const { awsAccounts } = require('aws-accounts');

awsAccounts.deserializeCredentials('./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 JSON/OBJECT

As a JSON
const { awsAccouts } = require('aws-accounts');

awsAccouts.getCredentials('JSON');
As a Text
const { awsAccouts } = require('aws-accounts');

awsAccouts.serializeCredentials('TEXT');

Add a new profile

const { awsAccounts } = require('aws-accounts');

awsAccounts.addProfile(options);

see Accepted Options

Edit a existing profile

const { awsAccounts } = require('aws-accounts');

awsAccounts.editProfile('PROFILE-NAME', options);

see Accepted Options

Switch to an existing profile

const { awsAccounts } = require('aws-accounts');

awsAccounts.switchProfile('NAME');

Remove a profile

const { awsAccounts } = require('aws-accounts');

awsAccounts.deleteProfile('NAME');

Save the current profiles to the aws file

const { awsAccounts } = require('aws-accounts');

awsAccounts.saveFile();

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

Import JSON profile file

const { awsAccounts } = require('aws-accounts');

awsAccounts.importCredentials('./path/to/the/file.json');

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

Export JSON profile file

const { awsAccounts } = require('aws-accounts');

awsAccounts.exportCredentials('./path/to/the/location/');

Accepted Options

OptionConfig EntryTypeDefault
name[name]Stringnull
aws_access_key_idaws_access_key_idStringnull
aws_secret_access_keyaws_secret_access_keyStringnull
regionregionStringnull
outputoutputStringjson
cli_timestamp_formatcli_timestamp_formatStringwire
cli_follow_urlparamcli_follow_urlparamBooleantrue
ca_bundleca_bundleStringnull
parameter_validationparameter_validationBooleantrue
tcp_keepalivetcp_keepaliveBooleantrue
max_attemptsmax_attemptsNumbernull
retry_moderetry_modeStringnull

Keywords

FAQs

Package last updated on 20 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc