Skip to main content

IAM Floyd

Release Documentation Construct Hub 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.

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"
}
Python
from iam_floyd import Statement

statement = (
    Statement.Ec2()
        .allow()
        .to_start_instances()
        .to_stop_instances()
        .if_resource_tag('Owner', '${aws:username}')
)
Java
import com.udondan.iamFloyd.statement.Ec2;

Ec2 statement = new Ec2()
    .allow()
    .toStartInstances()
    .toStopInstances()
    .ifResourceTag("Owner", "${aws:username}");
C#
using Statement = IAM.Floyd.Statement;

var statement = new Statement.Ec2()
    .Allow()
    .ToStartInstances()
    .ToStopInstances()
    .IfResourceTag("Owner", "${aws:username}");
Go
import (
	"udondan.github.io/iam-floyd/go/iamfloyd"
	"udondan.github.io/iam-floyd/go/iamfloyd/statement"
)

s := statement.NewEc2(nil).
	Allow().
	ToStartInstances().
	ToStopInstances().
	IfResourceTag(iamfloyd.String("Owner"), iamfloyd.String("${aws:username}"), nil)

Support for:

  • 455 Services
  • 22036 Actions
  • 2329 Resource Types
  • 2484 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
  • 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

# TypeScript / JavaScript
npm install iam-floyd           # or cdk-iam-floyd

# Python
pip install iam-floyd           # or cdk-iam-floyd

# Java (Maven), with the version of the release
#   com.udondan:iam-floyd       # or com.udondan:cdk-iam-floyd

# C# / .NET
dotnet add package IAM.Floyd    # or CDK.IAM.Floyd

# Go
go get udondan.github.io/iam-floyd/go/iamfloyd   # or .../go/cdkiamfloyd

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

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.

AWS and their services are trademarks, registered trademarks or trade dress of AWS in the U.S. and/or other countries.

This project is not affiliated, funded, or in any way associated with AWS.

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

Metadata

Release files for cdk-iam-floyd 0.849.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 cdk-iam-floyd 0.849.0
File Size Uploaded
cdk_iam_floyd-0.849.0.tar.gz 8.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cdk-iam-floyd 0.849.0
File Interpreter ABI Platform
cdk_iam_floyd-0.849.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.1 MB

Release files / cdk_iam_floyd-0.849.0.tar.gz

Download URL cdk_iam_floyd-0.849.0.tar.gz
Size 8.5 MB
Tags Source
SHA-256 checksum
How to use checksums
b44d88ecb68c31fc9af8d28f822cfb5f116e6611cea086650f78604c6924e5fd
BLAKE2b-256 checksum
How to use checksums
aa12862982c731627ef50323a6425037623140672c51e972ee54a805fe48c821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / cdk_iam_floyd-0.849.0-py3-none-any.whl

Download URL cdk_iam_floyd-0.849.0-py3-none-any.whl
Size 8.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
72e287a0047c9e37693009b3d63ebb709a9ea994ba4bca16f2a7b25c131d03a2
BLAKE2b-256 checksum
How to use checksums
bc0080a52ac8ddbe4ba298edee374f8010b3df5f32b3c62f920637ac69795c4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.849.0 This release

2 release files

0.99.0

2 release files

0.98.0

2 release files

0.97.1

2 release files

0.97.0

2 release files

0.96.2

2 release files

0.96.1

2 release files

0.96.0

2 release files

0.95.1

2 release files

0.95.0

2 release files

0.94.0

2 release files

0.93.0

2 release files

0.92.0

2 release files

0.91.0

2 release files

0.88.0

2 release files

0.87.0

2 release files

0.86.0

2 release files

0.85.0

2 release files

0.84.0

2 release files

0.83.0

2 release files

0.82.0

2 release files

0.81.0

2 release files

0.80.0

2 release files

0.79.0

2 release files

0.72.1

2 release files

0.72.0

2 release files

0.71.0

2 release files

0.70.1

2 release files

0.70.0

2 release files

0.69.0

2 release files

0.67.0

2 release files

0.66.0

2 release files

0.65.0

2 release files

0.64.0

2 release files

0.63.0

2 release files

0.62.6

2 release files

0.62.5

2 release files

0.61.0

2 release files

0.60.0

2 release files

0.59.0

2 release files

0.53.2

2 release files

0.52.4

2 release files

0.50.0

2 release files

0.49.0

2 release files

0.48.0

2 release files

0.47.0

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.43.0

2 release files

0.42.0

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.36.0

2 release files

0.35.1

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.27.8

2 release files

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