Prerequisites
- A Siteline website key
- An existing CloudFront distribution configured to write standard access logs to S3
- AWS CLI v2 configured for the target account
jqandzipinstalled locally- Node.js 18+ and npm
- IAM permissions for
s3,lambda,iam, andevents
CloudFront standard logs are delayed by design. Typical availability is 5-15 minutes after requests occur.
Setup
Configure environment variables
SITELINE_WEBSITE_KEYLOG_BUCKET_NAMEAWS_REGIONAWS_PROFILE(if using SSO or non-default profile)
How it works
This integration uses S3 log delivery, EventBridge, and Lambda:- CloudFront writes gzipped log files to S3.
- S3 sends
Object Createdevents to EventBridge. - EventBridge invokes the Lambda processor.
- Lambda downloads and gunzips the log file.
- Lambda parses the
#Fieldsheader dynamically, maps each valid row, and sends events to Siteline.
Configuration
Your Siteline website key. If missing, the Lambda exits without processing logs.
S3 bucket used for CloudFront standard logs. Lambda only reads objects from this bucket.
AWS region used by setup scripts and Lambda operations.
Region override for S3 bucket operations. Defaults to
AWS_REGION.Siteline intake endpoint. Defaults to
https://api.siteline.ai/v1/intake/pageview.Enables debug mode in the Siteline SDK.
Lambda function name. Default is
siteline-cloudfront-s3-processor.EventBridge rule name for S3 object-created events.
Required IAM policies
Lambda trust policy:Troubleshooting
No Lambda invocations
No Lambda invocations
Confirm CloudFront is writing standard logs to
LOG_BUCKET_NAME, then verify S3 EventBridge notifications are enabled on that bucket.No EventBridge to Lambda delivery
No EventBridge to Lambda delivery
Check targets with:
AccessDenied errors during setup or runtime
AccessDenied errors during setup or runtime
Ensure deployer permissions include S3, IAM, Lambda, and EventBridge management. Also confirm Lambda execution role has
s3:GetObject on the log bucket.How do I inspect processor logs?
How do I inspect processor logs?
Stream CloudWatch logs with: