Skip to main content
AWS CloudTrail

Collect your AWS CloudTrail logs using our Lambda function

Eldar Aliiev avatar
Written by Eldar Aliiev
Updated over 3 years ago

Coralogix provides a predefined Lambda function to easily forward your CloudTrail logs straight to Coralogix.

The preferred and easiest integration method will be to use our aws Serverless Application Repository. Search for 'coralogix'. Don't forget to check the 'Show apps that create custom IAM roles or resource policies' box located just under the search field to see all available applications. Select your application of choice and click on it. You will see detailed instructions in the readme section on the left.

The rest of this document describes a manual configuration of this integration and the Lambda associated with it and should be used if there is a need for special customization.

Setup

1. Create AWS CloudTrail trail and setup storage in your S3 bucket:

2. Create an “author from scratch” Node.js 10.x runtime lambda with S3 read permission:

3. At “Code entry type” choose “Upload a ZIP file” and upload “s3ToCoralogixCloudTrail.zip”:
https://s3-eu-west-1.amazonaws.com/coralogix-public/tools/s3ToCoralogixCloudTrail.zip

4. Add the mandatory environment variables: private_key, app_name, sub_name:

  • Private Key – A unique ID which represents your company, this Id will be sent to your mail once you register to Coralogix.

  • Application Name – Used to separate your environment, e.g. SuperApp-test/SuperApp-prod.

  • SubSystem Name – Your application probably has multiple subsystems, for example, Backend servers, Middleware, Frontend servers etc.

  • If your Coralogix account top level domain is not ‘.com’, add the following environment variable:

    CORALOGIX_URL=https://api.Cluster URL/api/v1/logs

Account Url Ending with .us

Account Url Ending with .com

Account Url Ending with .in

coralogix.us

coralogix.com

app.coralogix.in

5. Choose the S3 bucket you want to get triggered by and change the event type from “PUT” to “Object Created(All)”:

6. Increase Memory to 1024MB and Timeout to 1min:

7. Click "save".

Did this answer your question?