regulatethis
regulatethis

Reputation: 2362

How do I make fog use S3 Reduced Redundancy Storage

I'm managing some images in my app using Carrierwave and I want the files uploaded to S3 to use Reduced Redundancy Storage instead of Standard. Carrierwave uses fog to talk to S3, so how can I achieve this?

Upvotes: 1

Views: 287

Answers (1)

regulatethis
regulatethis

Reputation: 2362

After digging around for a while I ended up setting the following line in config/initializers/carrierwave.rb:

config.fog_attributes = { 
  'x-amz-storage-class' => 'REDUCED_REDUNDANCY'
}

What took me longest was finding the right attribute name and what value to send. This was a good resource: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html

Upvotes: 4

Related Questions