1.0.0 • Published 4 years ago

sam-policies v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

sam-policies-cli

CLI tool to browse and inject AWS Policy Templates into the Policies array of an AWS::Serverless::Function in a SAM template)

Installation

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

Usage

Options:
  -v, --vers                 output the current version
  -f, --format <json|yaml>   Select output format (default: "json")
  -t, --template <filename>  Template file name (default: "serverless.template")
  -h, --help                 output usage information

Example

Demo

Caveats

  • Both JSON and YAML options will reformat your template, but especially JSON shouldn't break it. It's therefore a good idea to run this command on a template without any local changes so you can easily diff the changes. For safety it will create a backup of your template in <template_filename>_backup before making any changes.
  • CloudFormation and SAM Polciy Templates are inconsistent with which intrinsic function should be used to inject the resource identifier to the policy template transformation. Somemtimes it's !Ref and sometimes !GetAtt We're making a manual mapping which could be wrong and assumes !Ref when no mapping exists.
1.0.0

4 years ago