Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serving files on S3 bucket through Cloudflare

I wanted to serve S3 bucket files through Cloudflare network, but encountered some issues. Integration instructions are given here, but they are suitable only for new buckets since bucket is required to be named subdomain.domain.com while my bucket is named domain.

Are there any other solutions to use CloudFlare with S3 without copying files from one bucket to another - like setting some redirects etc.? The problem is that my bucket contains more than 6 million files and that take 200 GB of storage.

Amazon S3 pricing rules are also hard to understand. I struggle to find information how much it costs to transfer information from one bucket to another if they are in the same location.

Thanks for answers.

like image 971
aemdy Avatar asked Sep 27 '22 06:09

aemdy


People also ask

How do I connect my S3 to Cloudflare?

Set up your site on CloudflareFor each bucket, you can find the URL in the AWS S3 console under Properties > Static website hosting > Endpoint. To get started: Follow the instructions to Create a Cloudflare account and add a website. If you already have an account, you can go directly to Add a domain to Cloudflare.

Can I access S3 bucket from browser?

An S3 bucket can be accessed through its URL. The URL format of a bucket is either of two options: http://s3.amazonaws.com/[bucket_name]/

How do you host a website on S3 without getting lost in the sea?

Click into your bucket. Select the “Permissions” tab at the top. Under “Public Access Settings” we want to click “Edit”. Change “Block new public bucket policies”, “Block public and cross-account access if bucket has public policies”, and “Block new public ACLs and uploading public objects” to be false and Save.


1 Answers

Unfortunately Amazon S3 requires that the cname conforms to the bucket name as you already found out. So basically you'll have to fix the name.

Here https://serverfault.com/questions/349460/how-to-move-files-between-two-s3-buckets-with-minimum-cost you can find how to copy files between buckets with minimum cost. Within the same zone, and with the right tools, you will not incur bandwidth costs, only the duplicate storage costs for the duration and access costs, details in the linked answer.

Your link to the cloudflare docs doesnt seem to be working anymore, this is the correct link: https://support.cloudflare.com/hc/en-us/articles/200168926-How-do-I-use-CloudFlare-with-Amazon-s-S3-Service-

like image 177
ahmeij Avatar answered Oct 06 '22 02:10

ahmeij