Skip to content

Instantly share code, notes, and snippets.

@dirtyhenry
Created June 4, 2013 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirtyhenry/5705385 to your computer and use it in GitHub Desktop.
Save dirtyhenry/5705385 to your computer and use it in GitHub Desktop.
This is the Ruby code I use to test/validate S3 access policies.
require 'fog'
connection = Fog::Storage.new({
:provider => 'AWS',
:aws_access_key_id => 'access_key_id',
:aws_secret_access_key => 'secret_acces_key'
})
directory = connection.directories.get('bucket_name')
puts directory.to_s
file = directory.files.create ({:body => "test", :key => "test"})
puts file.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment