Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

308
Views
CloudFront can't use S3 Website origin, only REST origin Cloudformation

I'm trying to automate spinning up a CloudFront distribution with S3 origin. I'd like to set the origin to the S3 website URL, e.g. mysite.com.s3-website-us-east-1.amazonaws.com. So, I thought my Cloudformation template should look like this:

{
"AWSTemplateFormatVersion" : "2010-09-09",
"Resources" : {
    "myDistribution" : {
        "Type" : "AWS::CloudFront::Distribution",
        "Properties" : {
            "DistributionConfig" : {
                "Origins" : [ {
                    "DomainName" : "mysite.com.s3-website-us-east-1.amazonaws.com",
                    "Id" : "myS3Origin",
...

However that yields the following error:

The parameter Origin DomainName does not refer to a valid S3 bucket.

Which is true, so I can specify the S3 bucket. But I want my origin to be the website endpoint. My non-automated workaround is to deploy with the S3 REST endpoint and update the origin in the UI after.

{
"AWSTemplateFormatVersion" : "2010-09-09",
"Resources" : {
    "myDistribution" : {
        "Type" : "AWS::CloudFront::Distribution",
        "Properties" : {
            "DistributionConfig" : {
                "Origins" : [ {
                    "DomainName" : "mysite.com.s3.amazonaws.com",
                    "Id" : "myS3Origin",
...

According to the docs:

The DNS name of the Amazon Simple Storage Service (S3) bucket or the HTTP server from which you want CloudFront to get objects for this origin.

I can't find anything about a website endpoint origin. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-origin.html#cfn-cloudfront-origin-originpath

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I don't think you've included quite all the relevant parts of your configuration.

The issue here is that an origin that is an S3 website hosting endpoint is not an S3 origin -- it's a custom origin.

Anything other than the REST endpoint of a bucket is always a custom origin.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!