Socket
Book a DemoInstallSign in
Socket

aws-config-utils

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-config-utils

Read AWS profiles, set AWS credentials (via AWS CLI)

0.4.0
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

aws-profile-utils

A utility library for reading AWS config profiles, and updating credentials using aws cli. Provides a few basic AWS definitions as well for convienence.

How it works

This project reads from your ~/.aws/config, and parses it into an array of profiles. It also exposes functionality to set credentials using the aws cli.

Reading config

We use os.homedir to locate your .aws folder, and open your config file. From there we do an initial scan of every line, turning it into a group of profiles and their associated lines. These lines are then parsed and transformed into their appropriate profile lines. Finally we do a reconciliation mapping every source_profile from a name into its actual profile. If a source_profile cannot be resolved into an actual profile, it is turned into undefined.

Setting credentials

We use the aws cli and NodeJS exec functionality to store credentials into the ~/.aws/credentials file. This means that we never read or touch your credentials file but means that your credentials could be mangled, and that we have a dependency on you having the aws cli available on your path. See aws-cli/aws-credential-writer.

WARNING: This does have the unfortunate side effect of making this not atomic, meaning that the risk of having the credentials mangled by a process being interrupted is high. We need to make three sequential calls to update the credentials, and if any of them are interrupted the credentials (that we are trying to save) will be mangled.

FAQs

Package last updated on 03 Oct 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.