This repository contains the code used by the LocationClosureAggregator-qa and LocationClosureAggregator-production AWS lambda functions. It primarily aggregates a series of closure alerts picked up by the LocationClosureAlertPoller. Specifically, it does the following:
- Determines the true length of each closure based on the alert data and the time the alerts were polled. See the TAD for specifics.
- Constructs closure records based on the determined length and other information from the closure alerts
- Inserts the resulting records into Redshift
- Deletes the closure alerts from the Redshift staging table
The Redshift connection parameters must be provided as REDSHIFT_DB_HOST
, REDSHIFT_DB_NAME
, REDSHIFT_DB_USER
, and REDSHIFT_DB_PASSWORD
environment variables in order for the code to run. It's also assumed that all of these variables except the database name have been encrypted via KMS.
This repo uses the Main-QA-Production git workflow.
main
has the latest and greatest commits, qa
has what's in our QA environment, and production
has what's in our production environment.
CI/CD is not enabled. To deploy a new version of this function, first modify the code in the git repo and open a pull request to the appropriate environment branch. Then run source deployment_script.sh
and upload the resulting zip. Note that if any files are added or deleted, this script must be modified. For more information, see the directions here.