Project

bukelatta

0.01
No commit activity in last 3 years
No release in over 3 years
Bukelatta is a tool to manage S3 Bucket Policy.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 3.0

Runtime

 Project Readme

Bukelatta

Bukelatta is a tool to manage S3 Bucket Policy.

It defines the state of S3 Bucket Policy using DSL, and updates S3 Bucket Policy according to DSL.

Installation

Add this line to your application's Gemfile:

gem 'bukelatta'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bukelatta

Usage

export AWS_ACCESS_KEY_ID='...'
export AWS_SECRET_ACCESS_KEY='...'
bukelatta -e -o Policyfile  # export Bucket Policy
vi Policyfile
bukelatta -a --dry-run
bukelatta -a                # apply `Policyfile`

Help

Usage: bukelatta [options]
    -k, --access-key ACCESS_KEY
    -s, --secret-key SECRET_KEY
    -r, --region REGION
        --profile PROFILE
        --credentials-path PATH
    -a, --apply
    -f, --file FILE
        --dry-run
    -e, --export
    -o, --output FILE
        --split
        --target REGEXP
        --no-color
        --debug
        --request-concurrency N

Policyfile example

require 'other/policyfile'

bucket "foo-bucket" do
  {"Version"=>"2012-10-17",
   "Id"=>"AWSConsole-AccessLogs-Policy-XXX",
   "Statement"=>
    [{"Sid"=>"AWSConsoleStmt-XXX",
      "Effect"=>"Allow",
      "Principal"=>{"AWS"=>"arn:aws:iam::XXX:root"},
      "Action"=>"s3:PutObject",
      "Resource"=>
       "arn:aws:s3:::foo-bucket/AWSLogs/XXX/*"}]}
end

bucket "bar-bucket" do
  {"Version"=>"2012-10-17",
   "Statement"=>
    [{"Sid"=>"AddPerm",
      "Effect"=>"Allow",
      "Principal"=>"*",
      "Action"=>"s3:GetObject",
      "Resource"=>"arn:aws:s3:::bar-bucket/*"}]}
end

Similar tools