01
Automatic failover
CloudFront origin groups retry against the DR Lambda on any 5xx, with no health checks.
Component 11
Serve a server-rendered site through CloudFront, with two Lambda origins that fail over to one another.
Inputs in, outputs out. Illustrative wiring, not a standalone deployment.
Supply the Lambda function URLs, the static assets bucket domains, and the cache and origin request policies. Provide an ACM certificate in us-east-1 for a custom domain. Configure provider requirements and credentials in your root module; check the documentation for all required inputs and version changes.
module "cloudfront" {
source = "pomo-studio/ssr-cloudfront/aws"
version = "~> 0.3"
app_name = "my-app"
primary_lambda_function_url = aws_lambda_function_url.primary.function_url
dr_lambda_function_url = aws_lambda_function_url.dr[0].function_url
static_root_path_patterns = ["/favicon*", "/robots.txt"]
enable_dr = true
}Key inputs
Useful outputs
01
CloudFront origin groups retry against the DR Lambda on any 5xx, with no health checks.
02
Routes /_nuxt/* and nominated root files to S3, everything else to Lambda.
03
Stale-while-revalidate keeps delivery fast while the Lambda refreshes content.
Built with