S3 Object Storage - Customizing URLs with CNAME
- Object-Storage
- CNAME
- domain
- S3
- buckets
If you are using Scaleway Object Storage, you might not want the scw.cloud
domain name to appear in your bucket’s URL. This may be the case if, for example, you are providing files to download or hosting the images of your website from a bucket. You may prefer a domain name such as download.mywebsite.com
to display on your links, instead of download.mywebsite.com.s3.fr-par.scw.cloud
.
In this tutorial, we show you how to use CNAME to map a domain or subdomain to an Object Storage bucket and access the files stored in the bucket via your own domain name.
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- You have an account and are logged into the Scaleway console
- You have access to the DNS zone of your domain name
- From the Scaleway console, create a new bucket. When entering a name for your bucket, the name must be exactly the same as the domain/subdomain intended to be used with it. For example, to create a bucket accessible at
download.example.com
the bucket name must bedownload.example.com
. - Set the bucket ACL with AWS-CLI:
aws s3api put-bucket-acl --bucket download.example.com --acl public-read
- Log into the administration panel of your domain and create a new record that defines the hostname as an alias for the bucket. For example, if the bucket
download.example.com
is located in the Paris region, the CNAME should point todownload.example.com.s3.fr-par.scw.cloud.
:
You can now access the file myapp.tar.gz
stored in the bucket download.example.com
directly at http://download.example.com/myapp.tar.gz
instead of the usual URL http://download.example.com.s3.fr-par.scw.cloud/myapp.tar.gz
.
SSL is not available when connecting to a bucket in this way.