Friday, March 24, 2017

Content Delivery Network CDN - Hands On

As soon as we login to the AWS console, we can see the CloudFront under the Networking & Content Delivery section:

Click on CloudFront to see this screen below:

The first thing is to create a distribution.


Creating a simple web distribution:
From the auto populated sections of the S3 buckets or Elastic Load Balancers, we can choose one of the S3 buckets object. Thats the origin domain name.

Origin Path : Can be a folder with in an S3 bucket, so that its not pointed to the root of the bucket. We can leave the origin path. There can be multiple origins in the same distribution.

We can restrict the bucket access, by clicking on Yes under restrict access. This restrict the public access of the S3 url object and the object cannot be accepted by the public using the S3 url, but only from the CloudFront.

Origin Access Identity: This is another way of restricting buckets.

The purpose of each of the options can be read from the information icon beside the field.

Restrict Viewer Access: Restricts the users from accessing the files by securing it. Only the authorized users can access the files.

Once the required settings are made which are quite a few, we can now create a distribution and access the same object that we have accessed using url of the S3 bucket we can access using the CloudFront Url, which will load the object from the cache of the edge location from the second user accessing it.

The Unique domain of the distribution can be configured to be able to remembered by a human.

Upon successfully creating the Distribution we can click the Id link to open the distribution and view other options:

Under the Restrictions --> Geo Restriction we can enable this and select either white or black list
and shuffle the countries under it.

White list : want the cloudFront to allow to distribute the content.
Black list :  dont want the cloudFront to allow to distribute the content.

We can create custom error pages when users get any errors they land on this page.

We can delete the distribution, we can select the distribution and click on disable it, it will take some 15 mins, after that we can delete the destribution.


No comments:

Post a Comment