AWS Lambda

Configure real-time event delivery to AWS Lambda functions for serverless event processing

The AWS Lambda destination allows you to send your event data directly to AWS Lambda functions in real-time. This enables serverless processing of your events using AWS's serverless compute service. With AWS Lambda, you can perform custom processing on your events such as:

  • Data transformation and enrichment
  • Custom hashing or encryption
  • Data validation and sanitization
  • Integration with other AWS services
  • Custom storage logic
  • Real-time analytics processing

Configuration

To set up the AWS Lambda destination:

  1. Navigate to the Destinations section in your account
  2. Click "Add Destination" and select "AWS Lambda"
  3. Provide the following information:
    • AWS Region
    • Lambda Function Name

Event Format

Events sent to your Lambda function will be in the following format:

{
  "event": {
    "event": "Order Completed",
    "event_properties": {
      "order_id": "12345",
      "total": 99.99
    },
    ...etc
  },
  "visitor": {
    "visitor_id": "visitor_123",
    "first_seen_at": "2024-01-01T00:00:00Z",
    "email": "example@example.com",
    ...etc
  },
  "user": {
    "external_id": "user_456",
    "email": "example@example.com",
    ...etc
  }
}

Delivery Guarantees

Events are delivered with at least once semantics. This means that each event may be delivered one or more times to your Lambda function. Duplicate events can occur due to network retries, system failures, or other transient conditions.

To ensure idempotent processing of events, your Lambda function should use visitor.visitor_id and/or event.distinct_id to identify and deduplicate events. These identifiers remain consistent across duplicate deliveries of the same event, allowing you to safely process events multiple times without side effects.

Best Practices

  • Ensure your Lambda function has appropriate access policies (you will need to contact a member of the Ours Privacy team for this)
  • Consider using environment variables for configuration
  • Implement proper error handling and retry logic in your Lambda function
  • Monitor Lambda function performance and set appropriate timeouts
  • Use AWS CloudWatch for logging and monitoring

How is this guide?

On this page

AWS Lambda Destination - Real-time Event Processing