https://github.com/bvsam/ticker-notifier
Event driven finance notifications powered by AWS
https://github.com/bvsam/ticker-notifier
aws finance ses
Last synced: over 1 year ago
JSON representation
Event driven finance notifications powered by AWS
- Host: GitHub
- URL: https://github.com/bvsam/ticker-notifier
- Owner: bvsam
- License: mit
- Created: 2024-10-15T01:54:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-18T21:01:41.000Z (over 1 year ago)
- Last Synced: 2025-02-04T22:24:30.285Z (over 1 year ago)
- Topics: aws, finance, ses
- Language: HCL
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ticker-notifier
## About
An AWS EventBridge chron job that triggers a Lambda function to send an email notification to a list of recipient email addresses when certain tickers have fallen a set percentage from their yearly highs.
## Usage
1. Install the dependencies required for the lambda function. These dependencies must be installed for the `manylinux2014_x86_64` architecture to `src/lambda/` to allow for the `src/lambda/` directory to be zipped and run as a AWS Lambda function.
```
pip install -r requirements.txt --platform manylinux2014_x86_64 -t src/lambda/ --only-binary=:all:
```
If you run into an error running the command above, run the command below on an Ubuntu 22.04 system (this can be done by running a Docker container with a bind mount).
```
pip install -r requirements.txt -t src/lambda/
```
2. Create a `.tfvars` file at `src/main.tfvars`. Fill out the `.tfvars` file with all the required variables, which can be seen in `main.tf`. An example of what a `main.tfvars` file might look like is provided below.
```
deployment_name = "ticker-notifier"
region = "us-east-1"
sender_email = "name@example.com"
recipient_emails = "[\"name@example.com\"]"
eventbridge_schedule_expression = "rate(1 day)"
```
Ensure that the `sender_email` is a verified email address and that the `recipient_emails` can receive emails from the sender. As an example, you can setup your AWS SES to send emails from your personal email (e.g. Gmail) to your personal email, after it's been verified. This must be manually setup using the AWS console before the terraform code can be applied.
3. Create a YAML config file for the Lambda function at `src/lambda/config.yaml`. Fill out the config file with valid configuration (an example is provided at `src/lambda/example_config.yaml`).
4. Initialize terraform and apply the terraform code. Within the `src/` directory, run the following:
```
terraform init
# Optional: terraform plan --var-file=main.tfvars
terraform apply --var-file=main.tfvars
```