# Extend S3 configuration for other S3 API compatible services

**URL:** https://meta.discourse.org/t/extend-s3-configuration-for-other-s3-api-compatible-services/90371
**Category:** Feature
**Created:** [June 21, 2018, 7:10am UTC](https://meta.discourse.org/t/extend-s3-configuration-for-other-s3-api-compatible-services/90371 "2018-06-21T07:10:42Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [June 22, 2018, 4:01pm UTC](https://meta.discourse.org/t/extend-s3-configuration-for-other-s3-api-compatible-services/90371/4 "2018-06-22T16:01:52Z")

</div>

> [@itsbhanusharma](#):
>
> Step 1:
> 
> Demonstrating in code how you would get aws-s3 gem to talk to a different provider. I have not researched that yet but that is the first blocker here.
> 
> This may not be trivial considering amazon are the ones maintaining that gem.

@sam I did the research and yes, this is well supported by aws-sdk-ruby even though the documentation is lacking. This is a demonstration of **aws-sdk-ruby** being used to upload an archive to **DigitalOcean Spaces**. This works really well and I hope this helps and gives everyone an idea about how compatible these services are.

**Steps:**

1. Create a [DigitalOcean Space](https://cloud.digitalocean.com/spaces/).
2. [Generate Access Keys](https://cloud.digitalocean.com/settings/api/) for your DigitalOcean Account.
3. Paste the Space name (_bucket_), key pair (_access\_key\_id, secret\_access\_key_), file name and path in the variables below. Run the code and the file should be visible in your Space.

```plaintext
require 'aws-sdk-s3'

name = 'test.tar.gz'
path = '/home/workspace/test.tar.gz'

# Before uploading, ensure that you've created a Space on DigitalOcean
bucket = 'discoursetest1'

# Configure an S3 Resource for use with Spaces
# Note: Generate Spaces Access Keys from cloud.digitalocean.com/settings/api/
s3 = Aws::S3::Resource.new(
    access_key_id: '',
    secret_access_key: '',
    endpoint: 'https://nyc3.digitaloceanspaces.com',
    region: 'nyc3',
    )

# Add a file to a Space
obj = s3.bucket(bucket).object(name)
obj.upload_file(path)

```

_Note:  
Read more about [DigitalOcean’s AWS S3 compatiblity here](https://developers.digitalocean.com/documentation/spaces/#aws-s3-compatibility) and the [AWS Ruby SDK here.](https://aws.amazon.com/sdk-for-ruby/)_

---

_[View the full topic](https://meta.discourse.org/t/extend-s3-configuration-for-other-s3-api-compatible-services/90371)._
