npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-assume-role-credential-helper

v0.0.1

Published

A command-line utility for vending assume-role credentials for the AWS CLI v2

Downloads

3

Readme

AWS Assume Role Credential Helper

What is this?

This is a command-line tool that serves as an adapter between the AWS credential_process interface (see AWS documentation) in ~/.aws/config and a call to aws sts assume-role. The credential_process system in the AWS CLI does not natively work with the output of aws sts assume-role and thus must be slightly adapted to work.

Why is this useful?

Firstly, the AWS CLI already supports assuming a role via the assume_role attribute. You should use that instead of this if you can.

This tool is only useful if you are using SSO as a root of authentication. At the moment, many of the AWS SDKs do not support assuming a role when the parent profile is using SSO. The AWS CLI does however support this so the usefulness of this tool is that bridges the gap left by lack of support for SSO based logins in the various AWS SDKs.

How to use this tool?

Step #1 - Installation

npm install aws-assume-role-credential-helper

Step #2 - Configuration

The following is an example configuration. You will very likely need to adapt this configuration to your needs.

[profile sso-root]
sso_start_url = https://myorg.awsapps.com/start
sso_region = us-east-1
sso_account_id = 123456789012
sso_role_name = MyIAMRole
region = us-east-1
output = json

[profile childprofile]
region = us-east-1
output = json
credential_process = aws-assume-role-credential-helper --profile sso-root --role-arn arn:aws:iam::123456789012:role/MySSORole --role-session-name logmein

In this example the childprofile profile will use the credential process tool to acquire AWS credentials. We've configured the credential_process attribute to use our tool to perform an aws sts assume-role and using the sso-root profile which is a standalone SSO profile.

This tool is even more powerful when used in a 3-level manner. Considering the following configuration.

[profile sso-root]
sso_start_url = https://myorg.awsapps.com/start
sso_region = us-east-1
sso_account_id = 123456789012
sso_role_name = MyIAMRole
region = us-east-1
output = json

[profile main]
region = us-east-1
output = json
credential_process = aws-assume-role-credential-helper --profile sso-root --role-arn arn:aws:iam::123456789012:role/MySSORole --role-session-name logmein

[profile custom]
role_arn = arn:aws:iam::123456789012:role/MyCustomRole
source_profile = main
region = us-east-1
output = json

In this example custom uses the built-in support for role assumption using credentials sourced from main. The main profile then delegates (through an external credential process) to our SSO root profile named sso-root.