1.0.0 • Published 6 years ago
sam-policies v1.0.0
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 informationExample

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
!Refand sometimes!GetAttWe're making a manual mapping which could be wrong and assumes!Refwhen no mapping exists.
1.0.0
6 years ago