This AWS Lambda function is designed to be triggered by an S3 bucket event when a new .parquet file is created/uploaded. It converts the contents of the parquet file to json format and sends the data to Falcon LogScale repository using an ingest (authentication) token.
Before you can deploy and use this Lambda function, you'll need the following:
-
An AWS account and AWS Lambda access.
-
An S3 bucket where your .parquet files are stored, and to trigger the Lambda function when new files are uploaded.
-
The necessary AWS IAM roles and permissions to access S3 and Lambda.
-
A Falcon LogScale account with a repository and ingest token for authentication.
Follow these steps to deploy the Lambda function:
-
Clone this GitHub repository to your local environment.
-
Customize the Lambda function code to suit your specific requirements. Ensure that the code correctly reads .parquet files and sends data to Falcon LogScale using the token.
-
Package your Lambda function code and its dependencies into a ZIP file.
-
Create a new Lambda function in the AWS Lambda console.
-
Configure the trigger for the Lambda function to be the S3 bucket that notifies on new .parquet file uploads.
-
Ensure that the Lambda function has the necessary IAM permissions to access S3 and any other AWS services required.
-
Set environment variables for the Lambda function, including the Falcon LogScale ingest token and api endpoint.
-
Deploy the Lambda function by uploading the ZIP file.
- Maximum zip size allowed by AWS Lambda funtion is 250mb.
- Please note this code uses fastparquet instead of pyarrow because of the size limit.
Configure the Lambda function using environment variables or configuration files as needed. Make sure to set the following variables:
baseUrl
: Falcon LogScale account urllogscaleToken
: Falcon LogScale API token for authentication.- other relevant configuration variables for your specific use case.
Once the Lambda function is deployed and configured, it will automatically trigger whenever a new .parquet file is uploaded to the specified S3 bucket. The function will convert the file to JSON and send the data to Falcon LogScale.
Useful Reference Links: