Creating CDN distributions
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.
|About this Tutorial|
|Last Updated||July 7, 2020|
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.
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.
Complete the following procedure to create a distribution.
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.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.13 — Enter a name for your distribution.
• 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.
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.
Recommended next steps
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 about Amazon Lightsail, and find more tutorials in our resource center.