Post

AWS Lab - AWS CloudFront

CloudFront


create an Amazon CloudFront distribution

create an Amazon CloudFront distribution that will use a CloudFront domain name in the url to distribute a publicly accessible image file stored in an Amazon S3 bucket.

  • Create a new Amazon CloudFront distribution
  • Use Amazon CloudFront distribution to serve an image file
  • Delete Amazon CloudFront distribution when it is no longer required

Task 1: Store a Publicly Accessible Image File in an Amazon S3 Bucket

  1. AWS Management Console > Services > S3 > Create bucket
  2. Permissions tab > Block public access > Uncheck the Block all public access. All five boxes should now be unchecked
  3. Upload file > Manage public permissions > Grant public read access to this object(s)
  4. file > Object URL

Task 2: Create an Amazon CloudFront Web Distribution

  1. AWS Management Console > Services > CloudFront.
  2. Create Distribution
    • delivery method: Web section
    • Origin Domain Name: the S3 bucket create
    • Scroll to the bottom of the page, then click Create Distribution

myimage.html

  • DOMAIN: Amazon CloudFront Domain Name
  • OBJECT: name of the file uploaded to Amazon S3 bucket
1
2
3
4
5
6
7
<html>
<head>My CloudFront Test</head>
<body>
<p>My text content goes here.</p>
<p><img src="https://DOMAIN/OBJECT" alt="my test image" /></p>
</body>
</html>

Task 4: Delete Your Amazon CloudFront Distribution

  1. Disable > delete

.

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.