> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate CDN resource with AWS S3

Before you start, please back up your files and database. The plugin works only with default CMS pattern. If you manually changed CMS patterns, the plugin might not help you.

Login to the [AWS Console](https://console.aws.amazon.com) and navigate to S3.

Create an S3 bucket (define the Bucket Name and the Region you want)

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/create-s3.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=9e120128d2af674797958d4aa880d68e" alt="Create an S3 bucket" width="1318" height="642" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/create-s3.png" />
</Frame>

Upload content to your S3 bucket.

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/upload-content-s33.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=4d226d46315a5bdeb2a33175c10ad735" alt="Upload content to your S3 bucket" width="672" height="818" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/upload-content-s33.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/upload-content-s3-2-1024x546.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=51e01734fd82b91eea8562d07a7feecf" alt="Upload content to your S3 bucket" width="1024" height="507" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/upload-content-s3-2-1024x546.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/upload-complete.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=2c00078fd21c3ea625299b45d216b753" alt="Upload content to your S3 bucket" width="983" height="226" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/upload-complete.png" />
</Frame>

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.

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/s3-enable-hosting1.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=969464bfcc18d91e486167f64fb6fd3e" alt="Enable Website Hosting" width="1677" height="1298" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/s3-enable-hosting1.png" />
</Frame>

Use the following example to set a Bucket Policy (replace "example-bucket" with your S3 bucket name):

```
{

 "Version":"2012-10-17",  
 "Statement":[{  
   "Sid":"PublicReadGetObject",  
       "Effect":"Allow",  
     "Principal": "*",  
     "Action":["s3:GetObject"],  
     "Resource":["arn:aws:s3:::example-bucket/*"  
     ]  
   }  
 ]  
}   
```

Add the bucket policy in the Permissions drop-down menu.

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/add-s3-bucket-policy.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=33c5bb5f08fcbe215f70b0647e87d8c7" alt="Permissions drop-down menu" width="1673" height="742" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/add-s3-bucket-policy.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/s3-bucket-policy-example.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=ec4578d1ac9182a8c1f51e6578cf2b37" alt="Permissions drop-down menu" width="1070" height="824" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/s3-bucket-policy-example.png" />
</Frame>

Check accessibility of the file at the URL link in the browser. For example, the link for the file from this guide is bucket.s3-website.eu-central-1.amazonaws.com/logo.png

<Frame>
  <img src="https://mintcdn.com/gcore/dxycBbQXMfI-sCbi/images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/s3-endpoint-url.png?fit=max&auto=format&n=dxycBbQXMfI-sCbi&q=85&s=c4ed6f430c43efddbda4352ac2671140" alt="Check accessibility " width="2362" height="1146" data-path="images/docs/cdn/getting-started/integrate-cdn-with-cms/integrate-cdn-resource-with-aws-s3/s3-endpoint-url.png" />
</Frame>

Log in to the [Gcore Customer Portal](https://portal.gcore.com/cdn/resources/list) and [create a CDN resource](/cdn/getting-started/create-a-cdn-resource/create-a-cdn-resource). Use S3 Endpoint as an origin source. For example, bucket.s3-website.eu-central-1.amazonaws.com

As soon as you create a Resource check accessibility of the content through the CDN by opening the URL link in the browser. For example, CNAME: awss3.site.com/logo.png. Ensure that your [CNAME record has been configured](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn) properly before using it for integration.

Integration has been completed! We highly recommend you to check the HTML code of your web page to ensure that URLs have been rewritten properly from your original ones to CNAME from the Gcore Customer Portal.

To do that press **F12** or open Developers Tools in your browser, choose the Network tab and refresh the page. All static files should have your CNAME in URLs.
