Parse vehicle positions and trip updates from a GTFS-realtime feed using AWS Lambda. Particularly useful when hooked up as a JSON API using AWS's API Gateway.
The Lambda handler expects a URL to passed through the event using the key url
(i.e. event['url']
).
- Create a virtualenv at
.env
-virtualenv .env
. - Build this project into a zip file by running
build.sh
. - Create a Lambda function through the AWS console or the AWS CLI using the built zip file.
- [OPTIONAL] Create an API Gateway endpoint that calls the Lambda function you created in step 2. To allow users of this endpoint to pass an arbitrary URL to the Lambda function, setup an input mapping template in API Gateway.
Want to get notified by text and email when a GTFS-realtime feed goes empty for more than N minutes? Check out this gist using Cronitor.