Levo's Lambda@Edge function to ingest traffic from AWS CloudFront distributions.
- Install the AWS CLI (version 2) by following the AWS docs.
- Run the
install.sh
script in this repository.
git clone https://github.com/levoai/aws-cloudfront-lambda
cd aws-cloudfront-lambda
./install.sh
- Go to the AWS CloudFront Console and select your distribution.
- Click on the "Behaviors" tab, then click on the "Create Behaviour" button.
- Configure the behaviour and ensure that the following properties are set:
- Path pattern: Use
*
to send all JSON payloads to Levo, or use a more specific API pattern - Origin and origin groups: The origin for which the traffic should be sent
- Allowed HTTP methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
- Cache policy: Set this to any policy as per your requirements
- Function Associations
Origin request
:- Function type:
Lambda@Edge
- Function ARN: Paste the "Request Handler ARN" value printed by the
install.sh
script - Include body:
Yes
- Function type:
Origin response
:- Function type:
Lambda@Edge
- Function ARN: Paste the "Response Handler ARN" value printed by the
install.sh
script
- Function type:
- Path pattern: Use
- Click on the "Create behaviour" button to save the configuration.
That's all! Within a few minutes, you should start seeing API catalogs in your Levo dashboard.