Skip to main content
POST
Update Lambda@Edge
Update the Lambda@Edge function with new bot patterns and propagate to all CloudFront distributions.

When to Use

Call this endpoint when you’ve updated the bot detection patterns in lambda_code.js and want to deploy the changes to all customer domains. Common reasons to update:
  • New AI bot released (e.g., new Anthropic crawler)
  • Bot User-Agent pattern changed
  • Bug fix in routing logic

What This Does

  1. Uploads new Lambda code from lambda_code.js
  2. Publishes a new Lambda version (e.g., :1 → :2)
  3. Updates all CloudFront distributions to use the new version (parallel batches)

Timing

Customer Impact

Zero downtime. CloudFront updates are rolling:
  • Old Lambda version continues handling requests
  • Traffic gradually shifts to new version
  • No interruption to customer websites

Authentication

This endpoint requires an internal API key. Include the X-API-Key header:

Example Request

Example Response

Response Fields

Workflow

Step 1: Update Bot Patterns

Edit Backend/src/app/domain/setup_proxy/step_0_lambda_setup/lambda_code.js:

Step 2: Deploy Changes

Step 3: Verify

The response shows how many distributions were updated. All customer domains will now detect the new bot patterns.

Rate Limiting

The endpoint processes distributions in batches of 10 with a 1-second delay between batches to respect AWS CloudFront API limits.

Error Handling

If some distributions fail to update:
  • Successfully updated distributions use the new Lambda
  • Failed distributions continue using the old Lambda (still works)
  • Retry the endpoint to attempt failed distributions again

Example Response with Failures

Security

This endpoint requires an internal API key and should only be used by admins. It modifies infrastructure that affects all customer domains.