Skip to main content

IAM Floyd

IAM Floyd: Build AWS IAM policies fluently.

Release Documentation Construct Hub codecov Maintainability License

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.

from iam_floyd import Statement

statement = (
    Statement.Ec2()
        .allow()
        .to_start_instances()
        .to_stop_instances()
        .if_resource_tag('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

pip 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.

Metadata

Release files for iam-floyd 0.855.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iam-floyd 0.855.0
File Size Uploaded Provenance Actions
iam_floyd-0.855.0.tar.gz 1.4 MB With provenance Details for iam_floyd-0.855.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iam-floyd 0.855.0
File Interpreter ABI Platform Actions
iam_floyd-0.855.0-py3-none-any.whl Python 3 none any Details for iam_floyd-0.855.0-py3-none-any.whl

Total release size: 3.3 MB

Release files / iam_floyd-0.855.0.tar.gz

Download URL iam_floyd-0.855.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
94f1491cd92e3516ddbfb7a5dc3842190d14d0bb1d4e89f934bfe63e4a11e62b
BLAKE2b-256 checksum
How to use checksums
89cc5e635f16029b715cb2acabd3f2362a4337816a423a7039bb5158328a761f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / iam_floyd-0.855.0-py3-none-any.whl

Download URL iam_floyd-0.855.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5775647070dc5f1049e313c98ad642c5cb825c5d66c67655f7b1f6249ee27852
BLAKE2b-256 checksum
How to use checksums
1862ed8df7b37f777ab0aaad6b8404ea9c503966c9e90d343259e42295d7127f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for iam-floyd 0.855.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for iam_floyd-0.855.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.855.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page