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

ssoprogen

v1.0.1

Published

[![Build Status](https://github.com/kirnberger1980/ssoprogen/actions/workflows/publish.yml/badge.svg)](https://github.com/kirnberger1980/ssoprogen/actions/workflows/publish.yml) [![License: Apache2](https://img.shields.io/badge/license-Apache%202-lightgre

Downloads

4

Readme

SSO Profile Generator

Build Status License: Apache2 TypeScript NPM Version Tweet

This tiny CLI Tool helps you creating AWS Profiles based on your AWS SSO (AWS IAM Identity Center) Account Assignments. Especially if you have to manage plenty of AWS Accounts using various IAM Roles, ssoprogen will quickly create all neccessary profiles for your ~/.aws/config file.

Installation

npm install -g ssoprogen

Or simply using npx which is a package runner bundled in npm:

npx ssoprogen

Prerequisites

In order to use ssoprogen properly , you need to have an access token, which is created by the the identity provider of AWS SSO. Therefore you need the initial configuration in your ~/.aws/config file:

[sso-session sso]
sso_start_url=https://<your sso instance name>.awsapps.com/start
sso_region=<the region where your sso instane is provisioned>
sso_registration_scopes=sso:account:access

[default]
sso_session=sso

With this configuration you can now perform

aws sso login

This will open the browser and you have to authenticate against the identity provider from AWS SSO (AWS IAM Identity Center). For more details, follow the instructions on Configure automatic token refresh.

Usage

There are two ways to create the neccesssary AWS profiles for your AWS CLI (~/.aws/config). With the following command you print out all available profiles for the user:

ssoprogen -c

You then have to copy the profiles manually in to your ~/.aws/config file. Caution: The tool will create the sso session and the default profile as well. If you prefer to overwrite ~/.aws/config file directly, then you can perform:

ssoprogen -p

If you have more than one IAM Role in an account, the profile name will be

<account name>-<role name without appending word role>

in lower case.

Example:

Your account name is machine-learning-dev and you have a role DataScientistRole assigned for this account, then the profile would look like

[profile machine-learning-dev-datascientist]
sso_session=sso
sso_account_id=111111111111
sso_role_name=DataScientistRole
region=us-west-2
output=json
cli_pager=cat

Hint: If your region for your AWS profiles differs from the region of the SSO instance, you can simply provide the region as follows:

ssoprogen -p -r "eu-central-1"

Furthermore you have the following options:

user@yourhost>ssoprogen -h
  ____ ____   ___    ____             __ _ _         ____                           _             
 / ___/ ___| / _ \  |  _ \ _ __ ___  / _(_) | ___   / ___| ___ _ __   ___ _ __ __ _| |_ ___  _ __ 
 \___ \___ \| | | | | |_) | '__/ _ \| |_| | |/ _ \ | |  _ / _ \ '_ \ / _ \ '__/ _` | __/ _ \| '__|
  ___) |__) | |_| | |  __/| | | (_) |  _| | |  __/ | |_| |  __/ | | |  __/ | | (_| | || (_) | |   
 |____/____/ \___/  |_|   |_|  \___/|_| |_|_|\___|  \____|\___|_| |_|\___|_|  \__,_|\__\___/|_|   
                                                                                                  
Usage: ssoprogen [options]

A CLI for generating Configuration File with AWS SSO Profiles for AWS CLI etc. based on AWS SSO.

Options:
  --version                                      output the version number
  -c, --create                                   Print a configuration File with AWS SSO Profiles for AWS CLI.
  -p, --populate                                 Populate a configuration File with AWS SSO Profiles for AWS CLI in ~/.aws/config.
  -r <region>, --region <region>                 The region to use for the configuration file. Defaults to SSO Region.
  -n <name>,--sso-session-name <name>            The SSO Session Name to use for the configuration file. Defaults to sso.
  -d <defaultRole>,--default-role <defaultRole>  The default role to use for the configuration file. The role name will not be appended in the profile name.
  -h, --help                                     display help for command