Created
March 29, 2018 07:51
-
-
Save barnumbirr/a3d7540d2816973bed75f825ea93ab7e 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
#!/usr/bin/ruby | |
require 'aws-sdk' # version 3 | |
role_credentials = Aws::AssumeRoleCredentials.new( | |
client: Aws::STS::Client.new(access_key_id:'', | |
secret_access_key:''), | |
role_arn: '', | |
role_session_name: '' | |
) | |
s3 = Aws::S3::Resource.new(credentials: role_credentials, region: 'eu-central-1') | |
s3.buckets.limit(50).each do |b| | |
puts "#{b.name}" | |
end | |
puts s3.bucket('oply.com-eu-central-1-819224168067').exists? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment