Last active
August 29, 2015 14:16
-
-
Save ardeearam/e359b95c208e43d6734b to your computer and use it in GitHub Desktop.
This file contains 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
# Reference: http://stackoverflow.com/questions/28351438/cannot-create-a-bucket-in-s3-using-ruby-aws-sdk-v2 | |
s3 = Aws::S3::Client.new(region: region, credentials: credentials) | |
bucket = s3.create_bucket(bucket: 'mynewbucket') | |
puts bucket.inspect | |
# List the available buckets | |
puts "Available buckets:" | |
resp = s3.list_buckets | |
resp.buckets.each do |bucket| | |
puts bucket.inspect | |
end | |
resp = s3.list_objects(bucket: 'existingbucket') | |
resp.contents.each do |object| | |
puts "#{object.key} => #{object.etag}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment