Created
August 23, 2017 19:17
-
-
Save localytics-gist/ac2a125f2053152de231f7f885b08730 to your computer and use it in GitHub Desktop.
humidifier-reservoir cogito example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'cogito' | |
| require 'humidifier/reservoir' | |
| require 'json' | |
| class PolicyMapper < Humidifier::Reservoir::BaseMapper | |
| attribute :policy do |policy| | |
| { | |
| policy_document: { | |
| Version: '2012-10-17', | |
| Statement: JSON.parse(Cogito.to_json(policy)) | |
| } | |
| } | |
| end | |
| end | |
| Humidifier::Reservoir.configure do |config| | |
| config.stack_path = 'stacks' | |
| config.map :policies, to: 'AWS::IAM::ManagedPolicy', using: PolicyMapper | |
| end | |
| Humidifier::Reservoir::CLI.start(ARGV) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| S3DefaultPolicy: | |
| description: Grants S3 permissions | |
| policy: > | |
| ALLOW s3:ListBucket ON *; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment