StorageGRID Webscale & AWS SDK for Ruby Version 2

In recent posts, we've covered how to access StorageGRID Webscale's S3 API and how to setup SSL certificates. In this post, we'll show you how to use the AWS SDK for Ruby Version 2 to access StorageGRID's S3 endpoint.


require 'aws-sdk'

s3 = 'us-east-1',
                         endpoint: '',
                         ssl_verify_peer: true,
                         ssl_ca_bundle: 'server.crt',
                         credentials: 'my_profile'),
                         force_path_style: true)

response = s3.list_buckets
response.buckets.each { |b| puts "Bucket: #{}, Creation-Date:#{b.creation_date}"}


Import is that you specify the region parameter as 'us-east-1'. Otherwise the SDK will complain about a missing parameter. The SDK will connect to the endpoint, which is specified in the endpoint field, in this case "", which is our StorageGRID Gateway node for S3.


For more information on how to use the Ruby SDK, have a look at AWS S3 Ruby SDK documentation.


Follow me on Twitter: @clemenssiebler