Deploy Custom Domain to Wasabi S3 bucket with Cloudflare

author

Lets Try

. 2 min read

Follow

What is Wasabi Hot Cloud Storage?

Wasabi is a cloud storage service that provides object storage services to businesses and individuals. It is similar to other cloud storage services such as Amazon S3, Microsoft Azure Storage, and Google Cloud Storage, but it is known for its low cost and high performance. Wasabi offers a range of storage options including hot storage, which is optimized for frequent access, and cold storage, which is optimized for infrequent access. Wasabi also provides a number of features such as versioning, lifecycle management, and cross-region replication.



Wasabi is accessed through a web-based console or through APIs and tools such as the AWS command-line interface (CLI) and software development kits (SDKs). It is often used for storing and managing large amounts of data, such as images, videos, and backups.


How to Use Custom Domain ( own sub domain or Main domain) for Wasabi S3 Bucket?

To use your own domain name for a bucket in Wasabi, you will need to create a CNAME record in the DNS configuration for your domain that points to the Wasabi bucket endpoint. Follow the steps below.

  • Login to your Wasabi and Cloudflare Account.
  • Create a Bucket ( Bucket Name and Sub Domain Name Should be same ). eg : Bucket Name & sub domain = cdn.developerbook.net .


  • Add a new CNAME record to the DNS configuration for your domain. The CNAME record should have the following values:
Name: This is the subdomain that you want to use for your Wasabi bucket. For example, if you want to use the domain cdn.developerbook.net, the name would be cdn.
Value: This is the endpoint of your Wasabi bucket that you determined in above step.
TTL (Time to Live): This is the length of time that the DNS record will be cached by DNS resolvers. You can typically leave this as the default value (Auto).
  • Determine the endpoint of your Wasabi bucket. You can find this information in the Wasabi console or by using the aws s3api list-buckets command in the AWS CLI. The endpoint will be in the format s3.wasabisys.com.
  • In the Target field while Adding new CNAME record on the DNS management page of Cloudflare, enter the appropriate address for your Wasabi Hot Cloud Storage bucket's region. For the us-east-1 region, enter <BUCKET>.s3.wasabisys.com. For all other regions, enter <BUCKET>.s3.<REGION>.wasabisys.com, replacing <REGION> as appropriate (e.g., <BUCKET>.s3.eu-central-1.wasabisys.com).

  • Save the CNAME record and wait for it to propagate. It may take some time for the changes to take effect, as DNS changes can take up to 24-48 hours to fully propagate.

Once the CNAME record has propagated, you should be able to access your Wasabi bucket using the subdomain that you specified in the CNAME record.


Add a Policy

"To make every file in your bucket automatically readable by anyone, you need to create a Bucket Policy."

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadGetObject",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::cdn.developerbook.net/*"
    }
  ]
}

The policy looks precisely as the one AWS is using. you can create new here : https://awspolicygen.s3.amazonaws.com/policygen.html




More Stories from Developerbook

Install Premium URL Shortener in DigitalOcean Cloud Server

Install Premium URL Shortener in DigitalOcean Cloud Server

How To Import and Export Large Database files in MySQL or MariaDB

How To Import and Export Large Database files in MySQL or MariaDB

How to setup Erlang on windows environment

How to setup Erlang on windows environment

How to configure eclipse plug-in for erlang

How to configure eclipse plug-in for erlang

Isolation concept for transaction

Isolation concept for transaction