Serverless Api Cloudfront

homepage icon https://github.com/Droplr/serverless-api-cloudfront
Follow @Droplr

Tracked

NPM Downloads Last Month
549
Issues
11
Stars
85
Forks
21
Watchers
85
Watch Star Fork Issue Download License NPM Build Status Coverage Status Contributors

Repo README Contents:

serverless-api-cloudfront

serverless npm version MIT licensed npm downloads

Automatically creates properly configured AWS CloudFront distribution that routes traffic to API Gateway.

Due to limitations of API Gateway Custom Domains, we realized that setting self-managed CloudFront distribution is much more powerful.

:zap: Pros

Installation

$ npm install --save-dev serverless-api-cloudfront

Configuration

# add in your serverless.yml

plugins:
  - serverless-api-cloudfront

custom:
  apiCloudFront:
    domain: my-custom-domain.com
    certificate: arn:aws:acm:us-east-1:000000000000:certificate/00000000-1111-2222-3333-444444444444
    waf: 00000000-0000-0000-0000-000000000000
    compress: true
    logging:
      bucket: my-bucket.s3.amazonaws.com
      prefix: my-prefix
    cookies: none
    headers:
      - x-api-key
    querystring:
      - page
      - per_page
    priceClass: PriceClass_100

Notes

domain:
  - my-custom-domain.com
  - secondary-custom-domain.com
headers: all
querystring: all
priceClass: PriceClass_All