How to set up a CloudFront for S3 bucket containing images for the website, using the same domain name that is already placed behind CloudFront.
1. Open CloudFront from a menu:
2. Click Create Origin:
3. Now, click in box and select the s3 bucket URL from this list. Click Yes, Edit:
4. Click behaviors tab and then click Create Behavior option:
5. Enter the detail as asked below, Path Pattern is the location under s3 bucket, like all image file are under Images folder, then use Images/*.jpg or Images/*.png, it depends on the file format which you are using, suppose if you are using multiple image file format then you have to create separate New Behavior for each format type.
Note: select the correct origin here also, save default settings as shown below:
So now your Image can be accessed using your domain name for the site.