In this repo you can find a CDK stack that builds a serverless application that runs AWS EMR when is needed.
Is a AWS Service that allows to create Infrastructure as code using the most popular languages like (Python, Typescript, Java and C#). You can deploy a simple stack to a complex modular infrastructure, edit it and make your cloud application scalable.
Also cam be used to deploy data infrastructure, and maintain it in asingle project, no more fitting roles and permissions in the console UI. As simple as write a line of code you can add or revoke access to your infrastructure.
We will build a Apache Spark as a service application, the idea is user AWS EMR as a service. We only load a script in AWS S3 and we trigger a process that creates the cluster, run the job and destroy the cluster at end.
- AWS CDK
- AWS Cloud Formation
- AWS S3
- AWS EMR
- AWS Lambda
- Set environmentVariables
export account_id=<Your Account Id> export bucket_name=<Name of the bucket> export data_bucket_arn=<arn of data bucket>
- Install node js
- Install aws cdk
npm install -g aws-cdk
- Set your credentials user
In this step you need a aws account and aws cli v2 installed in your computer
aws configure --profile cdk
- start your AWS cdk project
cdk init app --language typescript
- Write your code infrastructure
- transpile and synthesize the code (if you're using typescript)
npm run build cdk synth
- Bootstrap
cdk bootstrap --profile cdk
- Deploy
cdk deploy --profile cdk
- Load your script
- Wait for AWS makes magic and drink a coffee
- Watch the result
- hazardous-air-pollutants you can find it in https://www.kaggle.com/epa/hazardous-air-pollutants
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
- Repo owner or admin: Andres Jejen
- On twitter @andres_jejen
- On LinkedIn https://www.linkedin.com/in/german-andres-jejen-cortes/