Component 16

CloudFront Edge Router

Shift CloudFront requests between deployments at the edge, without an apply.

Status

Available component

Deployment scope

Global edge

Example version constraint

~> 0.1

Review published versions ↗

Usage example

Inputs in, outputs out. Illustrative wiring, not a standalone deployment.

Supply the deployment names and an initial active deployment. The router manages the Parameter Store entry, the sync Lambda, the key-value store, and the CloudFront Function. Configure provider requirements and credentials in your root module; check the documentation for all required inputs and version changes.

main.tf
module "edge_router" {
  source = "pomo-studio/cloudfront-edge-router/aws"
  version = "~> 0.1"

  name = "orders"

  deployments       = ["blue", "green"]
  active_deployment = "blue"
  weight            = 0
}

Key inputs

  • name
  • deployments
  • active_deployment
  • weight
  • pin_cookie
  • parameter_path

Useful outputs

  • function_arn
  • key_value_store_arn
  • sync_lambda_arn
  • parameter_name

What you get

01

Data-driven rollout

Change the active colour by updating a parameter.

02

Canary and pinning

Send a percentage to the next colour, or pin a viewer by cookie.

03

Edge-native

Route each request without a round trip to the origin.

  • Edge Blue/Green

    Shift traffic between two backend deployments at the edge, with canary weighting and cookie pinning.

  • Edge Configuration

    Keep routing and rollout configuration in Parameter Store and project it to the edge.

Built with

  • CloudFront Functions
  • KeyValueStore
  • Parameter Store
  • Lambda
  • Terraform