Adding custom domain to s3 bucket involves below steps

  1. Grant public read access to S3 bucket

  2. Create ssl certs for the custom domain using ACM

  3. Create CDN and map dns endpoint to custom domain

Grant public read access to S3 Bucket

{"Version": "2008-10-17",
"Statement": [{"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}]}

Replace ‘YOUR-BUCKET-NAME’ in the code with your real bucket name.

Create ssl certs for the custom domain using ACM

Create CDN and map dns endpoint to custom domain