Skip to content

Lambda to get the currency exchange rate and alert FX fluctuations via email

Notifications You must be signed in to change notification settings

syrilster/go-fx-fluctuation-alert-lambda

Repository files navigation

Quality Gate Status

fx-fluctuation-alert-lambda

  • A lambda function to get the currency exchange rate from the API provided by openexchangerates.org and sends an email if the FX price changes as per a preset threshold. (Can be changed form the lamnbda env vars)
  • This is run as a cloud watch scheduled event running every hour from 7AM to 06PM.
  • To avoid multiple emails during the day once the FX rate threshold is met, we add a dynamodb entry with a TTL of 10 hours with the currency value and hash of the current date as the primary key.
  • Subsequent emails will be sent only if the FX rate changes to a certain percent within a day. (Example increase of 50 cents)

Uploading lambda to AWS

  • GHA runs on master is available to deploy zip to AWS lambda automatically.
  • Execute these commands in root folder:
    GOOS=linux GOARCH=amd64 go build -o fx_alert
    zip main.zip fx_alert prod.yaml config/prod.yaml
    

About

Lambda to get the currency exchange rate and alert FX fluctuations via email

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published