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

iam-floyd

v0.855.0

Published

AWS IAM policy statement generator with fluent interface

Readme

IAM Floyd

Release Documentation Construct Hub codecov Maintainability License

[!NOTE] Unofficial community project. Not affiliated with, endorsed or authorized by Amazon Web Services (AWS).

AWS IAM policy statement generator with a fluent interface, for TypeScript, JavaScript, Python, Java, C# and Go.

IAM Floyd has a class for every AWS service, with a method for every action, resource type and condition key. Your IDE completes them and shows their documentation, so you neither look up action names and ARN formats, nor deploy policies with typos.

import { Statement } from 'iam-floyd';

const statement = new Statement.Ec2()
  .allow()
  .toStartInstances()
  .toStopInstances()
  .ifResourceTag('Owner', '${aws:username}');
{
  "Condition": {
    "StringLike": {
      "ec2:ResourceTag/Owner": "${aws:username}"
    }
  },
  "Action": ["ec2:StartInstances", "ec2:StopInstances"],
  "Resource": "*",
  "Effect": "Allow"
}

Support for:

  • 464 Services
  • 23049 Actions
  • 2421 Resource Types
  • 2584 Condition keys

Features

  • Complete: generated from the AWS documentation, and updated every week
  • Access levels: add all actions of an access level, e.g. allReadActions() or allWriteActions()
  • Regular expressions: add all actions that match a pattern with allMatchingActions('/vpn/i')
  • Resources: build ARNs with a method per resource type, e.g. onBucket('example-bucket'), with defaults for partition, region and account
  • Conditions: a method per condition key, with operators like ForAnyValue:StringEquals or IfExists
  • AWS CDK: cdk-iam-floyd statements are an iam.PolicyStatement of the AWS CDK, and the on*() methods take constructs, e.g. onBucket(bucket)
  • Policies: a policy document that knows the maximum size of its type, validates its estimated size and splits itself into several policies
  • Collections of common statements, and the names of all AWS managed policies
  • Policy converter: turn an existing JSON policy into IAM Floyd code with the online converter

Packages

IAM Floyd comes in two variants, with the same API and the same version number in every language:

  • iam-floyd creates statements as JSON, for the AWS SDKs, CloudFormation, Terraform or anything else that takes an IAM policy. The packages have no dependencies. In Python, Java, C# and Go, they are native and do not need Node.js.
  • cdk-iam-floyd creates statements of the AWS CDK v2. In Python, Java, C# and Go, they are built with jsii, like the AWS CDK itself, and need Node.js.

| Language | iam-floyd | cdk-iam-floyd | | ----------------------- | -------------------------------------- | ---------------------------------------------- | | TypeScript / JavaScript | npm | npm | | Python | PyPI | PyPI | | Java | Maven Central | Maven Central | | C# / .NET | NuGet | NuGet | | Go | Go | Go |

Installation

npm install iam-floyd

IAM Floyd has not reached 1.0.0 yet, and the API can still change between releases. Pin the exact version.

The requirements of each package and the compatibility with the AWS CDK are listed in the documentation.

Documentation

The documentation explains all features, with examples in every language.

Auto completion demo

License

IAM Floyd is licensed under Apache License 2.0. Dependencies might be released under different licenses.

Disclaimer

This is an unofficial, independent open-source project and is not affiliated with, funded or endorsed by Amazon Web Services, Inc. or its affiliates. AWS and the names of its services are trademarks, registered trademarks or trade dress of AWS in the U.S. and/or other countries. The names are used only to describe compatibility.

The service models in the lib/generated/model folder, and the code generated from them, are derived from the AWS documentation. The class- and function-names and their description therefore are property of AWS.

Use at your own risk. IAM Floyd generates policy statements but does not check what they allow, so review them before you deploy them.