title: How to access Amazon S3 data via AWS CloudFront in r?
body: <p>I built an r shiny web app in rStudio that pulls data from an Amazon S3 bucket using the access key, secret access key and region via EC2 in <code>Sys.setenv()</code> but would like to utilize AWS CloudFront. I already set up a CloudFront distribution via the AWS online console for the Amazon S3 bucket in question but do not quite understand how to actually assure data is pulled via CloudFront rather than EC2. I could also be misunderstanding the relationship between Amazon S3 and EC2/CloudFront, thus any information is much appreciated.</p>