Answers.Body: <p>I wrote up an article that might be helpful for future-people looking for step by step instructions on setting this up: <a href="https://nystudio107.com/blog/using-aws-s3-buckets-cloudfront-distribution-with-craft-cms" rel="nofollow noreferrer">Setting Up AWS S3 Buckets + CloudFront CDN for your Assets</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-27T20:18:28.380Z
Answers.LastActivityDate: 2020-01-27T20:18:28.380Z
Answers.UserDisplayName: andrew.welch
Answers.Body: <p>Okay -- this was easy -- I was taking the instructions too literally.  You have to replace the S3 URL with the CloudFront URL.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-03T16:43:52.370Z
Answers.LastActivityDate: 2018-05-03T16:43:52.370Z
Answers.UserDisplayName: Hellyar
Body: <p>I have the P&amp;T Amazon S3 plugin.   It's connected to my S3 bucket.  It stores a few test .PDF files.   It is working.  I am able to access the files - and the URL is that of my S3 bucket - i.e., <code>my-bucket-name.s3.amazonaws.com/filename.pdf</code></p>
  
  <p>I created a CloudFront distribution.   It is deployed and enabled.  </p>
  
  <p>I added my CloudFront <code>Distribution ID</code> to the <code>CloudFront Distribution ID</code> field in the plugin.   <strong>Do I need to add the distribution's Domain Name to any of the plugin's settings?</strong> </p>
  
  <p><strong>How do I know if the image is being accessed through CloudFront?</strong>  The URL has not changed - i.e., - i.e., <code>my-bucket-name.s3.amazonaws.com/filename.pdf</code></p>
  
  <p>I can access the .PDFs in my S3 bucket using the CloudFront domain name -- i.e., <code>cloud-front-domain-name.cloudfront.net/filename.pdf</code>.</p>
  
Tags: <assets><plugins><s3>
Title: How do you setup CloudFront in P&T S3 plugin & how do you know if it works?
ThreadText: # How do you setup CloudFront in P&T S3 plugin & how do you know if it works?
  
  (Asked by: username_0 on 2018-05-03)
  
  I have the P&T Amazon S3 plugin. It's connected to my S3 bucket. It stores a few test .PDF files. It is working. I am able to access the files - and the URL is that of my S3 bucket - i.e., `my-bucket-name.s3.amazonaws.com/filename.pdf`
  
  I created a CloudFront distribution. It is deployed and enabled.
  
  I added my CloudFront `Distribution ID` to the `CloudFront Distribution ID` field in the plugin. **Do I need to add the distribution's Domain Name to any of the plugin's settings?**
  
  **How do I know if the image is being accessed through CloudFront?** The URL has not changed - i.e., - i.e., `my-bucket-name.s3.amazonaws.com/filename.pdf`
  
  I can access the .PDFs in my S3 bucket using the CloudFront domain name -- i.e., `cloud-front-domain-name.cloudfront.net/filename.pdf`.
  
  **Tags:** assets, plugins, s3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-01-27. Score: 2
  
  I wrote up an article that might be helpful for future-people looking for step by step instructions on setting this up: [Setting Up AWS S3 Buckets + CloudFront CDN for your Assets](https://nystudio107.com/blog/using-aws-s3-buckets-cloudfront-distribution-with-craft-cms)
  
  
  ---
  
  ### Answer by username_0 on 2018-05-03. Score: 1
  
  Okay -- this was easy -- I was taking the instructions too literally. You have to replace the S3 URL with the CloudFront URL.
  
  
  ---
  
  