AWS S3 CDN Integration

This article will guide you trough a AWS S3 CDN integration. The majority of the configuration will be done in the AWS console. The S3 bucket, which we create later, will be the origin server.

  1. Login to the AWS Console and navigate to S3.
  2. Create an S3 bucket (define the Bucket Name and the Region you want).
    create s3 bucket
  3. Upload content to your S3 bucket.
    go to upload content s3upload content s3s3 upload complete
  4. “Enable website hosting” and define the Index Document (does not need to exist e.g. index.html) for your S3 bucket under Properties > Static Website Hosting.
    s3 enable hosting
  5. Use the following example to add a Bucket Policy (replace the bold string with your S3 bucket name).
    {
      "Version":"2012-10-17",
      "Statement":[{
    	"Sid":"PublicReadGetObject",
            "Effect":"Allow",
    	  "Principal": "*",
          "Action":["s3:GetObject"],
          "Resource":["arn:aws:s3:::example-bucket/*"
          ]
        }
      ]
    }
  6. Add the bucket policy in the Permissions drop-down.
    add s3 bucket policy
    s3 bucket policy example
  7. Test the accessibility of your S3 bucket with the Endpoint URL.
    s3 endpoint urls3 endpoint test
  8. Login to the KeyCDN dashboard and create a pull zone use the S3 Endpoint as your Origin URL.
    keycdn s3 origin
  9. Access your content through the Zone URL (in this example http://s3-1.kxcdn.com/keycdn-logo.png).
    keycdn s3 example