Created
March 25, 2020 16:08
-
-
Save gingray/9f86d886d44ec03cc00e0c45328ed22c to your computer and use it in GitHub Desktop.
Ruby script to test AWS S3
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'yaml' | |
require 'aws-sdk-s3' | |
access_key="" | |
secret_access_key="" | |
region="" | |
bucket_name="" | |
s3 = Aws::S3::Client.new( | |
region: region, | |
credentials: Aws::Credentials.new(access_key,secret_access_key), | |
) | |
s3.list_objects(bucket: bucket_name).each do |response| | |
puts response.contents.map(&:key) | |
end | |
puts s3.get_bucket_policy(bucket: bucket_name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment