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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@davidpellerin/accountfactory

v0.0.22

Published

AWS Organizations setup and management tool for creating and managing multi-account setups

Readme

🏭 accountfactory

codecov npm version contributions welcome

A command-line tool for managing AWS Organizations, creating accounts, and setting up IAM users across multiple accounts.

Features

  • Create and manage AWS Organizations accounts (eg: shared, staging, and production environments)
  • Set up IAM users across multiple accounts
  • Configure AWS CLI profiles automatically
  • Store credentials securely in AWS Secrets Manager

Installation

npm install -g @davidpellerin/accountfactory

Prerequisites

  • Node.js 18 or higher
  • AWS CLI installed and configured with appropriate credentials
  • AWS Organizations access in your root/management account

Usage

accountfactory - AWS Infrastructure deployment tool

Options:
  -V, --version                 output the version number
  -h, --help                    display help for command

Commands:
  list-accounts                 📋 List accounts in your AWS Organization
  generate-skeleton             💀 Generate a skeleton accountfactory.json file
  create-accounts [options]     🚀 Deploy accounts in your AWS Organization
  setup-aws-profiles [options]  🔧 Configure AWS profiles using creds from Secrets Manager
  help [command]                display help for command

List AWS Organization Accounts

$ AWS_PROFILE=organizations accountfactory list-accounts

┌─────────┬───────────────────────────────────┬────────────────┬─────────────┐
│ (index) │ Email                             │ Id             │ Status      │
├─────────┼───────────────────────────────────┼────────────────┼─────────────┤
│ 0       │ '[email protected]'      │ '012345678901' │ 'ACTIVE'    │
│ 1       │ '[email protected]'             │ '012345678902' │ 'ACTIVE'    │
│ 2       │ '[email protected]'          │ '012345678903' │ 'ACTIVE'    │
│ 3       │ '[email protected]'          │ '012345678904' │ 'SUSPENDED' │
└─────────┴───────────────────────────────────┴────────────────┴─────────────┘

^ In this example I ran this command with AWS_PROFILE=organizations (which is a profile I specifically setup with permissions to manage my organization. (see: IAM permissions)

Generate Skeleton

$ accountfactory generate-skeleton

Creates an accountfactory.json file in your current directory. It is a json file that you can modify with the list of accounts you want accountfactory to create. It will look like this:

{
  "accounts": [
    {
      "accountName": "Shared Services",
      "profileName": "myappname-shared",
      "email": "[email protected]"
    },
    {
      "accountName": "Staging",
      "profileName": "myappname-staging",
      "email": "[email protected]"
    },
    {
      "accountName": "Production",
      "profileName": "myappname-production",
      "email": "[email protected]"
    }
  ]
}

Create New Accounts

$ accountfactory create-accounts --username <iam-username>

Iterates through the accounts in accountfactory.json and creates those accounts in your AWS Organization.

Setup AWS Profiles

$ accountfactory setup-aws-profiles --username <iam-username> --prefix <profile-prefix>

This command creates profiles in (~/.aws/credentials) for each account. This command uses the aws cli tool under the hood.

Security

This tool requires high-privilege AWS credentials and should be used with caution. It's recommended to:

  • Use MFA-protected credentials
  • Review all actions before confirming
  • Follow the principle of least privilege
  • Regularly rotate credentials

IAM Permissions

Although you could theoretically just give your account AdministratorAccess that's really not a good practice.

One good way of limiting the blast radius is to use a dediacted organizations "management account" that you will use to create and manage the child accounts.

Here are the permissions that I use:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "organizations:CreateAccount",
        "organizations:DescribeCreateAccountStatus",
        "organizations:DescribeAccount",
        "organizations:ListAccounts",
        "organizations:ListAWSServiceAccessForOrganization",
        "organizations:EnableAWSServiceAccess",
        "organizations:DescribeOrganization",
        "organizations:ListChildren",
        "organizations:ListRoots"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "iam:CreateRole",
        "iam:AttachRolePolicy",
        "iam:PutRolePolicy",
        "iam:CreatePolicy",
        "iam:ListRoles",
        "iam:GetRole"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": ["sts:AssumeRole"],
      "Resource": "arn:aws:iam::*:role/OrganizationAccountAccessRole"
    }
  ]
}

Environment Variables

| Variable | Value | Purpose | | ----------------------------- | ----- | ------------------------------------------------------- | | ACCOUNTFACTORY_ENABLE_LOGGING | true | Enables logging to disk (~/.local/state/accountfactory) |

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details