EasyCDN is AWS CDK pattern that takes care about configuration of the infrastructure required to securely deliver content through AWS CloudFront.
AWS CloudFront is a convenient approach for static content distribution. Unfortunately, it requires a boilerplate AWS CDK code to bootstrap the provisioning of required resources. This library implements a high-order components on top of AWS CDK that simplify the deployment.
The latest version of the library is available at its main
branch. All development, including new features and bug fixes, take place on the main
branch using forking and pull requests as described in contribution guidelines.
npm install --save easycdn
import * as pure from 'aws-cdk-pure'
import * as easy from 'easycdn'
// creation of CDN requires definition of
// - site name
// - tls certificate arn
const cdn = easy.CDN(
'cdn.example.com',
'arn:aws:acm:us-east-1:000000000000:certificate/xxxxxxxx-xx...xxxx',
)
//
// injects CDN to your stack and get reference to origin s3 bucket
const stack = new cdk.Stack(/* ... */)
const origin = pure.join(stack, cdn)
The project is MIT licensed and accepts contributions via GitHub pull requests:
- Fork it and clone
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
git clone https://github.com/fogfish/easycdn
cd scud
npm install
npm run build
npm run test
npm run lint