This project sets up an AWS Lambda function that fetches stock data from Finnhub API and stores it in S3.
- Install the required packages:
pip install -r requirements.txt- Set up your AWS and Finnhub credentials:
python setup_credentials.py- Test your credentials:
python test_credentials.py- Deploy the Lambda function:
python deploy.pyYou can modify the configuration in config.py:
- AWS region
- Lambda function settings
- S3 bucket name
- EventBridge schedule
If you encounter this error, make sure:
- You've run
setup_credentials.pyand entered your AWS credentials - Your
.envfile contains valid AWS credentials - You've run
test_credentials.pyto verify your credentials work
- S3 bucket doesn't exist: Create the S3 bucket specified in
config.py - IAM permissions: Make sure your AWS user has permissions to create Lambda functions, IAM roles, and EventBridge rules
- Region issues: Make sure the region in your credentials matches the region in
config.py
deploy.py: Main deployment scriptlambda_function.py: Lambda function codeconfig.py: Configuration settingssetup_credentials.py: Helper script to set up credentialstest_credentials.py: Helper script to test credentials.env: Contains your AWS and Finnhub credentials (not in git)requirements.txt: Python dependencies