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 = {
  Version: '2012-10-17',
  Statement: [
    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:

  • 455 Services

  • 22036 Actions

  • 2329 Resource Types

  • 2497 Condition keys

Similar projects