IAM Floyd

Attention

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

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.

It comes in two variants: iam-floyd creates statements as JSON, for the AWS SDKs or anything else that takes an IAM policy, and cdk-iam-floyd creates statements of the AWS CDK. See Packages to choose and install one, and Getting Started for the first steps.

const policy = new ManagedPolicyDocument(
  new Statement.Ec2()
    .allow()
    .toStartInstances()
    .ifAwsRequestTag('Owner', '${aws:username}'),
  new Statement.Ec2()
    .allow()
    .toStopInstances()
    .ifResourceTag('Owner', '${aws:username}'),
  new Statement.Ec2() //
    .allow()
    .allListActions()
    .allReadActions(),
);

Support for:

  • 464 Services

  • 23049 Actions

  • 2421 Resource Types

  • 2584 Condition keys

Similar projects