The lambda function to normalize Vanguard Canada ETF
overview raw data and extract country breakdown
This lambda function is the 2nd step of a state machine
. After the first step Scrape Vanguard Canada ETF funds
is completed, this lambda function will be triggered.
This lambda function normalize the fund overview data in vanguard_fund_overview
collection and save them into fund_countries
collection.
This project follows the clean architecture with minor variation
├── api
│ └── lambda
├── bin
│ ├── cmd
│ └── lambda
├── cmd
├── config
├── consts
├── entities
├── infrastructure
│ └── repositories
│ └── mongodb
│ ├── models
│ └── repo
└── usecase
└── breakdown
To build the project for different environment set env variable LIBRARY_ENV
. Default environment is dev
. Check How To
section to learn how to add new build env.
Bellow command will build a lambda function
to deploy to AWS
. The output binary file is in `./bin/api/lambda/main
# Build lambda function
make build
Bellow command is to build a command line
to run locally
. The output binary file is in `./bin/cmd/main
# Build cmd
make build-cmd
Bellow command is to clean up the build
# Clean
make clean
- Make a copy of
config_dev.go
and change the suffix to new environment name. For example, addingstaging
the new file should be namedconfig_staging.go
. - Change the build tag (the first line) to new environment name. For example, changing
// +build dev
to// +build staging
- Finally, update the variable values in new config file accordingly.
- To build the project for the newly added environment don't forget to set env variable
LIBRARY_ENV
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
This project is not an opensource project. Please contact the owner for permission.