Latest Version
Download the latest version of the AWS SDK for Ruby:
gem install aws-sdk
New Features
| Change | Description |
|---|---|
| AWS::S3 Streaming Uploads and Downloads |
AWS::S3::S3Object#write and #read can now both stream object
data.
s3 = AWS::S3.new
obj = s3.buckets['my-bucket'].objects['key']
# upload a file to s3 in chunks
obj.write(Pathname.new('/path/to/file.txt'))
# download a file in chunks
File.open('output.txt', 'w') do |file|
obj.read do |chunk|
file.write(chunk)
end
end
|
| AWS::S3 Client-Side Encryption |
You can now encrypt your data locally before uploading to
Amazon S3. To do this you need to provide an encryption
key.
require 'openssl'
s3 = AWS::S3.new
obj = s3.buckets['my-bucket'].objects['key']
# generate a key
key = OpenSSL::PKey::RSA.new(1024)
# upload data, encrypting it first
obj.write('Hello World!', :encryption_key => key)
# read without the encryption key returns the encrypted data
obj.read
#=> "\xE6)\x8B9K/j\x9D\xACK\x8Et\xEEf\x1CQ"
# download and decrypt the data
obj.read(:encryption_key => key)
#=> 'Hello World!'
See the documentation for AWS::S3::S3Object for more information. Special thanks to the commit author Greg Nazario. You can view his full commit here. |
Supported API Versions
This release of the SDK supports the following API versions:
| Service | API Version |
|---|---|
| Amazon CloudWatch | 2010-08-01 |
| Amazon DynamoDB | 2011-12-05 |
| Amazon Elastic Compute Cloud | 2012-07-20 |
| Amazon Elastic MapReduce | 2009-03-31 |
| Amazon Route 53 | 2012-02-29 |
| Amazon Simple E-mail Service | 2010-12-01 |
| Amazon Simple Notifications Service | 2010-03-31 |
| Amazon Simple Queue Service | 2011-10-01 |
| Amazon Simple Storage Service | 2006-03-01 |
| Amazon Simple Workflow Service | 2012-01-25 |
| Amazon SimpleDB | 2009-04-15 |
| Auto Scaling | 2011-01-01 |
| AWS CloudFormation | 2010-05-15 |
| AWS Identity and Access Management | 2010-05-08 |
| AWS Security Token Service | 2011-06-15 |
| Elastic Load Balancing | 2012-06-01 |