# @mhlabs/iam-policies-cli

> A CLI tool for building simple to complex IAM policies

Latest version **1.0.7** (published 2023-12-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mhlabs/iam-policies-cli
pnpm add @mhlabs/iam-policies-cli
yarn add @mhlabs/iam-policies-cli
bun add @mhlabs/iam-policies-cli
```

Provides the command `iam-pol`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-12-05 |
| First published | 2020-02-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 9.6 MB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | mhlabs |
| Maintainers | mhlabs |
| Keywords | aws, iam, policies, serverless, cloudformation, sam |

## Links

- npm: https://www.npmjs.com/package/@mhlabs/iam-policies-cli
- Homepage: https://github.com/mhlabs/iam-policies-cli#readme
- Issues: https://github.com/mhlabs/iam-policies-cli/issues
- npm.io page: https://npm.io/package/@mhlabs/iam-policies-cli

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [inquirer](https://npm.io/package/inquirer.md) ^7.0.4
- [jsonpath](https://npm.io/package/jsonpath.md) ^1.1.1
- [yaml-cfn](https://npm.io/package/yaml-cfn.md) ^0.2.3
- [commander](https://npm.io/package/commander.md) ^4.1.1
- [clipboardy](https://npm.io/package/clipboardy.md) ^2.2.0
- [inquirer-autocomplete-prompt](https://npm.io/package/inquirer-autocomplete-prompt.md) ^1.3.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2023-12-05
- 1.0.5 — 2022-10-12
- 1.0.4 — 2022-01-10
- 1.0.3 — 2021-06-01
- 1.0.2 — 2021-03-01
- 1.0.1 — 2021-03-01
- 1.0.0 — 2021-02-14
- 0.0.8 — 2020-03-05
- 0.0.7 — 2020-02-27
- 0.0.6 — 2020-02-27
- 0.0.5 — 2020-02-26
- 0.0.4 — 2020-02-26
- 0.0.3 — 2020-02-23
- 0.0.2 — 2020-02-21
- 0.0.1 — 2020-02-21

## README

## iam-policies-cli

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).  

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](https://github.com/aws-cloudformation/cfn-python-lint/blob/master/src/cfnlint/data/CloudSpecs/us-east-1.json)

### :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](https://github.com/mhlabs/iam-policies-cli/blob/master/images/demo-connectors.gif?raw=true)

## 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](https://github.com/mhlabs/iam-policies-cli/blob/master/demo.gif?raw=true)

---
_Source: https://npm.io/package/@mhlabs/iam-policies-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
