Skip to content

Instantly share code, notes, and snippets.

@barnumbirr
Created March 29, 2018 07:51
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 barnumbirr/a3d7540d2816973bed75f825ea93ab7e to your computer and use it in GitHub Desktop.
Save barnumbirr/a3d7540d2816973bed75f825ea93ab7e to your computer and use it in GitHub Desktop.
#!/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