GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ayobuba/EventDrivenPythonAWS: This repository is created for creating an event driven Python ETL processing in AWS of COVID-19 US data.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

33 Commits
33 Commits

Folders and files

NameName
Last commit message
Last commit date
datanalysis
datanalysis
 
 
images
images
 
 
lambda_etl
lambda_etl
 
 
lambda_filedownload
lambda_filedownload
 
 
pythondist
pythondist
 
 
scripts
scripts
 
 
testdata
testdata
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
backend.tf
backend.tf
 
 
buildspec.yml
buildspec.yml
 
 
cloudwatch.tf
cloudwatch.tf
 
 
data.tf
data.tf
 
 
inputs.tfvars
inputs.tfvars
 
 
locals.tf
locals.tf
 
 
main.tf
main.tf
 
 
outputs.tf
outputs.tf
 
 
providers.tf
providers.tf
 
 
rds_postgre.tf
rds_postgre.tf
 
 
s3.tf
s3.tf
 
 
sns.tf
sns.tf
 
 
test_results.pdf
test_results.pdf
 
 
variables.tf
variables.tf
 
 

Repository files navigation

EventDrivenPythonAWS

This repository is created for creating an event driven Python ETL processing in AWS of COVID-19 US data.

Prereqisites

  1. Create a bucket to store terraform state.

  2. Create secrets in Secret Manager. Use secret tye as "Other type of secrets" Use these Keys : username and password

Steps

  1. Update backend.tf file with your unique bucket name and you can region as well.

  2. Update inputs.tfvar file with your inputs. Use above created secret manager in secret name.

  3. Run bellow scripts

terraform init

terraform plan

terraform apply -var-file="inputs.tfvars"

  1. Test failed scenario by updating wrong file name as input. First lambda function will fail to dowloand the file and send email to susbcribed users of ERROR topic.
aws lambda invoke \
    --function-name covid19etl-dev-download-lambda \
    --payload '{ "name": "Ankit" }' \
	--region us-east-1 \
    response.json
  1. You can pass another valid URL but not the same as our source. In this case, our download lambda would be succesfull but ETL lambda will fail and send notification to susbcribed users of ERROR topic.

  2. Run below command to trigger DOWNLOAD lambda function manually and then further it will trigger ETL and load data into Database and send notification to susbcribed users of SUCCESS topic.

  3. Use buildspec.yml to create AWS Code Build pipeline for deployment.

  4. Remember to approve SNS subscription from your mail box.

Testing

If you want to simulate failiure senario and whether next day it will pick up both failed date data and current day data. Upload files available into "testdata" folder into an S3 public bucket and pass on URLs as input to lambda function by changing tfvars file and redeploy terraform.

  • Test-0 : Input: _day0 files URLs. Deploy using terraform apply. Run lambda invoke AWS CLI. It will load complete data set into DB.
  • Test-1 : Input: _fail files URLs. Deploy using terraform apply. Run lambda invoke AWS CLI. It will fail due to incorrect data.
  • Test-2 : Input: _success files URLs. Deploy using terraform apply. Run lambda invoke AWS CLI. It will be successful and both days data will loaded.

You can have a look of test result available in "test_results.pdf"

Architecure Diagram

Screenshot

Dasboard in AWS QuickSights

Follow below link if you are facing issues with accessing database from AWS Quicksight.

Screenshot

https://medium.com/@felipelopezhamann/connect-aws-quicksight-to-an-rds-in-a-vpc-eb1ab1bb539a

About

This repository is created for creating an event driven Python ETL processing in AWS of COVID-19 US data.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.