cloudfront-emulator

https://img.shields.io/badge/Development%20Status-WORK%20IN%20PROGRESS-orange

Test your lambda@edge functions locally.

Have you ever found it frustrating to develop lambda@edge functions? Are you tired of editing your code, publishing a new version, updating the Cloudfront distribution, clear the cache, waiting for propagation to finish, and waiting to see your logs in Cloudwatch?

Demo

To demo this, clone the repo down and run

go run ./... example/cookie-redirect

Configuration Files

---
config:
  port: 3000 # defaults to 443
  addr: localhost # defaults to localhost
  origins:
    example:
      domain: example.com
      path: /
  behaviors:
    - path: /*
      origin: example
      events:
        viewer-request:
          path: ./ # defaults to the path passed into the emulator
          handler: index.handler
        origin-request:
          handler: index.handler
        origin-response:
          handler: index.handler
        viewer-response:
          handler: index.handler

To Do

  • emulator CLI command
    • use terraform to determine origin and behavior configurations
  • validate header modification
    • viewer-request
    • origin-request
    • origin-response
    • viewer-response

GitHub

View Github