This project runs Traccar on AWS Lambda, processing requests and returning responses.
The following environment variables are required:
S3_BUCKET_NAME
: The name of the S3 bucket where response files will be uploaded.
This Lambda function handles responses differently based on their size:
- Compresses the response data
- Uploads it to the specified S3 bucket
- Returns a JSON object with a pre-signed URL to the uploaded file:
The pre-signed URL is valid for 1 hour by default.
{ "url": "https://your-bucket.s3.amazonaws.com/response-uuid.gz?..." }
- Compresses the response data
- Returns the compressed data directly in the response body
- Sets appropriate headers (Content-Encoding: gzip)
Make sure to:
- Create an S3 bucket for storing the response files
- Set the
S3_BUCKET_NAME
environment variable in your Lambda function configuration - Ensure the Lambda execution role has permissions to write to the specified S3 bucket