Ruby developers are able to use Backblaze B2 Cloud Storage with the AWS SDK for Ruby via the Backblaze S3 Compatible API. Below is an example of configuring the required variables and creating a bucket:
require 'aws-sdk-s3'
#v2: require 'aws-sdk'
s3 = Aws::S3::Client.new(
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
region: 'us-west-002',
endpoint: 'https://s3.us-west-002.backblazeb2.com'
)
s3.create_bucket(bucket: '<bucket-name>')
The S3 Compatible API for Backblaze B2 Cloud Storage allows 1000’s of integrations to work with B2 natively. If you’re new to the S3 Compatible API, please see our Getting Started Guide. If you have any trouble using the AWS SDK for Ruby with B2, please let us know by emailing us at b2feedback@backblaze.com.
Articles in this section
- Object Lock FAQs
- Delivering Private Backblaze B2 Content Through Cloudflare CDN
- Bunny Integration Quick Start Guide
- Guide for using Fastly Compute @ Edge with Backblaze B2
- SSE Command Line and API Examples
- Does the B2 S3 Compatible API support Pre-Signed URLs?
- How to use Fastly CDN with B2
- Using the AWS SDK for Java (v2) with B2
- How to use the AWS SDK for Python with B2.
- Using the AWS SDK for PHP with Backblaze B2 Cloud Storage