Creating CDN distributions

with Amazon Lightsail

Amazon Lightsail is the easiest way to get started with AWS. It offers virtual servers, storage, databases and networking, plus a cost-effective, monthly plan.

This tutorial shows you how to create an Amazon Lightsail distrubution using the Lightsail console, and describe the distribution settings that you can configure. For more information about distributions, see Content delivery network distributions in Amazon Lightsail

Get started with Amazon Lightsail for free. 

About this Tutorial
Time 10-20 minutes      
Cost Free
Use Case Compute
Products Amazon Lightsail
Level 200
Last Updated July 7, 2020

Step 1: Prerequisites

Complete the following prerequisites before you get started with creating a distribution. 

1.1 — Create a Lightsail account, and instance to host your content. The instance serves as the origin of your distribution. The origin stores the original, definitive version of your content. For more information, follow this tutorial. 

Already have an account? Log in to your account

1.2 — Attach a Lightsail static IP to your instance. Your instance's default public IP address changes if you stop and start your instance, which will break the connection between your distribution and your origin instance. A static IP does not change if you stop and start your instance. For more information, see Create a static IP and attach it to an instance in Amazon Lightsail.


You can create a static IP and attach it to your instance when you create your distribution. You don't have to attach a static IP to your instance before getting started with creating your distribution.

1.3 — Upload your content and files to your instance. Your files, also known as objects, typically include web pages, images, and media files, but can be anything that can be served over HTTP.

1.4 — (Optional) Create a Lightsail load balancer if your website requires fault tolerance. Then attach multiple copies of your instance to your load balancer. You can configure your load balancer (with one or more instances attached to it) as the origin of your distribution, instead of configuring your instance as the origin. For more information, see Create a Lightsail load balancer and attach instances to it.

Step 2: Create a distribution

Complete the following procedure to create a distribution.

2.1 —Sign in to the Lightsail console.

2.2 — On the Lightsail home page, choose the Networking tab. 

2.3 — Choose Create distribution. 

2.4 —In the Choose your origin section of the page, choose the AWS Region in which your origin resource was created.


Distributions are global resources. They can reference an origin in any AWS Region, and distribute its content globally.

2.5 — Choose your origin. An origin can be an instance or a load balancer (with one or more instances attached to it). For more information, see Origin resource. 

2.6 — (Optional) To change your origin protocol policy, choose the pencil icon displayed next to the current origin protocol policy that your distribution uses. For more information, see Origin protocol policy. 


This option is listed in the Choose your origin section of the page, under the origin resource you selected for your distribution.

2.7 — Choose the caching preset for your distribution. For more information, see Caching preset

2.8 —  (Optional) Choose Show all settings to view additional caching behavior settings for your distribution.

2.9 — (Optional) Choose the default behavior for your distribution. For more information, see Default behavior.

2.10 —  (Optional) Choose Add path to add a directory and file override to your distribution's caching behavior. For more information, see Directory and file overrides

2.11 — (Optional) Choose the pencil icon displayed next to the advanced setting you want to edit for your distribution. For more information, see Advanced cache settings

2.12 —  Choose your distribution plan. For more information, see Distribution plans.

2.13 — Enter a name for your distribution.


Resource names:
• Must be unique within each AWS Region in your Lightsail account.
• Must contain 2 to 255 characters.
• Must start and end with an alphanumeric character or number.

2.14 —  Review the cost of your distribution, and choose Create distribution

Your distribution is created after a few moments.

Congratulations

You created a distribution using Amazon Lightsail. 

Amazon Lightsail is a great choice to develop, build, and deploy a variety of applications like WordPress, websites, and blog platforms.

Was this tutorial helpful?

Thank you
Please let us know what you liked.
Close
Sorry to disappoint you
Is something out-of-date, confusing or inaccurate? Please help us improve this tutorial by providing feedback.
Close

Create a DNS

Create a Lightsail DNS zone to manage your domain's DNS in the Lightsail console. This allows you to easily map yourdomain to your Lightsail resources. Read more here

Create a SSL/TLS certificate

Create a Lightsail SSL/TLS certificate for your domain to use it with your distribution. Lightsail distributions require HTTPS, so youmust request an SSL/TLS certificate for your domain before you can use it with your distribution. For more information, see Creating SSL/TLS certificates for your distribution in Amazon Lightsail.

Learn more

Learn more about Amazon Lightsail, and find more tutorials in our resource center.