GitPedia

Iam policies cli

A CLI tool for building simple to complex IAM policies

From ljacobsson·Updated January 5, 2026·View on GitHub·

CLI for generating AWS IAM policy documents, SAM policy templates or [SAM Connectors](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/managing-permissions-connectors.html) based on the [JSON definition](https://awspolicygen.s3.amazonaws.com/js/policies.js) used in the [AWS Policy Generator](https://awspolicygen.s3.amazonaws.com/policygen.html). The project is written primarily in JavaScript, first published in 2020. Key topics include: aws-tools, iam.

Latest release: 1.0.5
October 12, 2022View Changelog →

iam-policies-cli

CLI for generating AWS IAM policy documents, SAM policy templates or SAM Connectors 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

:tada: New in v1.0.5 - support for AWS::Serverless::Connectors

If you point a SAM template to this tool it will suggest connectable resources and let you generate the AWS::Serverless::Connector resource
Demo

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

Contributors

Showing top 3 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from ljacobsson/iam-policies-cli via the GitHub API.Last fetched: 6/21/2026