Amazon CloudFront is a content delivery service (CDN) that accelerates the delivery of static and dynamic content over the Internet. With the CloudFront product from AWS, you can deliver content to end users with low latency and high speed, reducing website load time and improving the user experience. To distribute content through CloudFront, you must configure the source of the content.
In this Coliseu Geek special article, you will learn how to create a distribution on AWS CloudFront by integrating files from AWS S3 with just a few steps. If you have any questions, feel free to comment at the end of our article.
Step 1: Create a Bucket in AWS S3
Before creating a distribution on AWS CloudFront, you must have an AWS S3 bucket set up with the content you want to distribute. If you don't already have a bucket set up, follow the steps below:
- Access the AWS Management Console at https://console.aws.amazon.com/.
- Click on the S3 service.
- Click the “Create Bucket” button and follow the on-screen instructions to configure the bucket.
- Upload the files you want to distribute to the bucket.
Step 2: Create a Distribution in AWS CloudFront
Now that you have a bucket set up with the content you want to distribute, it's time to create a distribution in AWS CloudFront.
- Access the AWS Management Console at https://console.aws.amazon.com/.
- Click on the CloudFront service.
- Click the "Create Distribution" button.
- Select the type of distribution you want to create: “Web” or “RTMP”.
- In the “Source” section, select the S3 bucket you configured in Step 1. Select the “Restrict Bucket Access” option and configure access policies as needed.
- In the “Cache Settings” section, select the cache settings you want to use for distribution. For example, you can configure the cache duration for each object.
- In the "Distribution Settings" section, configure distribution options such as domain name, SSL and pricing.
- Click the “Create Distribution” button to create the distribution.
Step 3: Test the distribution
Now that you've created the distribution, it's time to test it.
- Wait a few minutes for the distribution to be created and configured.
- Go to the URL of the distribution (for example, https://000000000000.cloudfront.net) in a web browser. If the distribution is set up correctly, you should see the content you set up in the S3 bucket.
Creating a distribution on AWS CloudFront by integrating files from AWS S3 is an easy and effective way to speed up the delivery of static and dynamic content over the internet.
With just a few clicks in the AWS Management Console, you can set up a deployment that provides your end users with a fast and reliable experience. Remember of configure the correct access policies to ensure that only authorized users can access content in the AWS S3 bucket.