This project contains serverless application deployable to AWS for automatic tracking of worked hours in BambooHR. Project also contains functionality for notifying about current tracked timesheets per day / week. Project is implemented using GoLang programming language and serverless framework.
Current project creates CloudFormation stack that contains
- AWS StepFunction that orchestrates lambda steps for uploading timesheet and notifying about emails
- s3 bucket for storing timesheets
- EventBridge for triggering StepFunction
Project also contains definition of terraform stack
- verification of SES email identity (it's not part of CloudFormation stack since this is not supported by CloudFormation). This is for sending notification emails about current time tracking values. This terraform stack should be applied before deploying CloudFormation stack.
- Parses timesheet entries from yaml file in s3 bucket (by default it retrieves file by key
timesheet.yml
) - If there is current day in parsed config it continues. Otherwise, it terminates
- Logs in to BambooHR using credentials in environment variables
- Uploads timesheet entries for current day to bambooHR
- Terminates
- Logs in to BambooHR using credentials in environment variables
- Retrieves logged working hours for current day and week
- Sends an email using AWS SES to/from emails specified as environment variables with HTML content of logged hours.
- Terminates
After cloning repository it is required to install dependencies.
make install
This is required one time only.
Also create a copy of timesheet entries
cp timesheet.dst.yml timesheet.yml
And modify this timesheet according to your need. Important - name of the weekdays must be lowercase
Update your custom values in terraform directory and execute in that directory
terraform apply
Environment variables needed before deployment
BAMBOO_HOST
- environment variable containing hostname of your company bambooHRBAMBOO_USERNAME
- your username used for logging in to BambooHRBAMBOO_PASSWORD
- your password used for logging in to BambooHRDAILY_TIME_TRACKING_SENDER_EMAIL
- email address to send time tracking notifications fromDAILY_TIME_TRACKING_RECIPIENT_EMAIL
- email address to receive time tracking notifications from
Another option is to store those env variables into .env
file, they will be picked up by make.
make deploy STAGE=YOUR_STAGE //STAGE is optional, be default it is "dev"
You can copy content of your local timesheet.yml
to s3 by running
make uploadTimesheet
Execute command
make test
Content of this project was created only for research purposes. Definitely not for automatic tracking of working hours due to laziness.