title: How to allow CloudFront to access certain S3?
body: <p>I'm new to AWS. Now I want to write a java code to use CloudFront to access a s3.</p>
  
  <p>I create a S3 bucket. But I don't know how to get cloudfront object using S3 credentials.</p>
  
  <p>I read the AWS JAVA API, it seems that the code should be in this form:</p>
  
  <pre><code>AmazonCloudFrontClient cloudfront = new AmazonCloudFrontClient(credentials);
  CreateCloudFrontOriginAccessIdentityRequest originRequest = new CreateCloudFrontOriginAccessIdentityRequest();
  originRequest.setRequestCredentials(credentials);
  
  cloudfront.createCloudFrontOriginAccessIdentity(originRequest);
  </code></pre>
  
  <p>But I don't see a S3ID or something to set the S3 to the cloudfront.</p>