Two weeks ago we released a complete solution for deploying serverless websites that supports custom domain, SSL & CDN in a single website component. Since then we’ve received great feedback about related use cases of the underlying infrastructure and we realized there is a need for a standalone content delivery network solution to serve your static assets, even if they’re not directly related to your website.

Today we’re releasing the zero-config Serverless CDN component to serve that exact use case. Just like the website component, it supports secure SSL-enabled custom domains and is powered by AWS S3, AWS CloudFront, AWS Route53 & AWS Certificate Manager. All can be deployed with only 2 lines of YAML.

Deploying the Serverless CDN Component

To deploy the Serverless CDN component, you’ll need to first install the latest version of the Serverless Framework if you haven’t done that already.

npm i -g serverless

Once installed, make sure you have set your AWS keys in your machine. For more info regarding setting AWS keys, checkout this guide.

Once you’re done with that, you’ll have over 30 serverless components that you can instantly deploy with a single YAML file. In this article, we will focus on the Serverless CDN component. To deploy the Serverless CDN component, just create a serverless.yml template file in the current working directory. This YAML template file should have the following content:

1
myServerlessCDN:
2
  component: "@serverless/cdn"

#serverless #cdn

Easily Deploy A Serverless CDN With Serverless Components
2.20 GEEK