Mini Project on CloudFront Distribution
Asma Akram
1 x AWS Certified || 1 x Oracle Gen AI Certified || Ex Freshworks || Ex TCS
Hello Friends I have completed a mini project on CloudFront distribution.
Following are the steps I followed for the project.
? First I created a S3 bucket
? Uploaded an image file in the bucket
? Created a Folder named CutomErrors in S3 Bucket
? Created simple webpages for displaying error page (Error.html) and for telling the user the users that the content is blocked for their location(Block.html).
? Created a CloudFront distribution?.
? In the Origin Domain name , I gave the address of S3 bucket created previously.
? Distribution creation will take 5 to 10 mins.
? Copy the domain name of CloudFront distribution and append the image file name with the distribution and hit the url, you will quickly see the image file via the CloudFront domain.
? You will see CloudFront URL loads the image file very fast.
领英推荐
? Select the CloudFront distribution and select the Error pages and created Custom Error Response with HTTP error code as 404 Not found and gave the Response Path Page as the URL of folder along with error page?which we created in S3 bucket for custom errors
? Deploy the changes and it will take 5/10 mins to completely reflect the changes
? Next access the CloudFront domain with any other image file name which doesn't exist in S3 bucket, you will get the Custom Error page which means that Error page is correctly working.
? Next I made the Geographic Distribution of my Content restricted.
? For this I clicked on Geographic locations tab of CloudFront distribution and selected Block list under Restriction Type and Selected my Country.
? Selected the CloudFront distribution and select the Error pages and created Custom Error Response with?Http Error Code: Select 403: Forbidden gave the Response Path Page as the URL of folder along with the block page which we created in S3 bucket for custom errors
?Deploy the changes and it will take 5/10 mins to completely reflect the changes
? Next access the CloudFront domain with image file URL and you will be able to see the block page.
If you see the error, this means you successfully configured a custom error page and restricted image access from your country.
I hope you enjoyed reading the post. Do implement the project and get hands on practice on CloudFront!!!
Great work, Asma Akram. Keep up the good work.
Ingénieur Informaticienne| Professional Scrum Master (PSM1) | AWS Certified
1 年Well done Asma
Versatile professional driving efficiency, innovation, client satisfaction and growth.
1 年Good going Asma. All the best