@mhlabs/iam-policies-cli

A CLI tool for building simple to complex IAM policies

Usage no npm install needed!

<script type="module">
  import mhlabsIamPoliciesCli from 'https://cdn.skypack.dev/@mhlabs/iam-policies-cli';
</script>

README

iam-policies-cli

CLI for generating AWS IAM policy documents or SAM policy templates based on the JSON definition used in the AWS Policy Generator.

Provide an optional SAM or CloudFormation template and it will let you reference resource ARNs using intrinsic functions for defined resources.

The mapping of CloudFormation resource type -> the intrinsic function that returns the ARN is based on the cfn-lint schema for us-east-1

New in v1.0.3 - you can now merge polices back to your template. Suppoerted resources are AWS::Serverless::Function, AWS::Serverless::StateMachine, AWS::IAM::Role

Installation

npm install -g @mhlabs/iam-policies-cli

Usage

Example: iam-pol -t template.yaml -f yaml

Options:
  -v, --vers                        output the current version
  -t, --template <filename>         Template file name (default: "serverless.template")
  -f, --format <JSON|YAML>          Output format (default: "JSON")
  -o, --output <console|clipboard>  Template file namePolicy output (default: "console")
  -h, --help                        output usage information

Example

Demo