Wrong origin of CloudFront distribution
I have tried to create my serverless blog with custom domain sls-blog.myowndomain.xyz
[]
bucketName: 'sls-blog.myowndomain.xyz'
domain: sls-blog.myowndomain.xyz
[]
But it ends up with the error as below when I access my own domain
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist</Message>
<BucketName>sls-blog</BucketName>
When I navigate to the Cloudfront Console, I recognize that the CloudFront distribution is trying access the origin as sls-blog.s3.amazonaws.com. Which I really have no chance to own it.
I tried to change the origin to the s3 bucket website domain and It seems to be working now.
Is Serverless components mistaking on create cloudfront distribution ? I have check the code and find nothing seem to be wrong.
For now, you cannot use domain name with dot (.), you have to replace dot to another character (i.e. -). For example sls-blog-myowndomain-xyz will work.
Check out more details at https://medium.com/innomizetech/how-do-we-host-our-static-website-b0b60f2a09f2