Terminate EMR cluster to save costs
AWS EMR is managed hadoop framework available for to be launched and used in a highly secured network in order to implement big data use cases. This EMR cluster will be launched in the AWS account and is priced as it is launched
So in order save costs and optimum usage of EMR clusters in your account, we can implement an automated boto3 script that would terminate the any status[RUNNING, WAITING, STARTING, BOOTSTRAPPING] EMR clusters
Steps to implement:
- Create a lambda-> python2.7 script in your account where this automated EMR termination needs to be implemented
- Download the code from my github [https://github.com/gvnirmalaa/utilities]
- Copy the script into your Lambda code section and click 'Save'
- Now go to 'Cloud watch' -> Create Rule -> Cron scheduler -> set the timings as per requirement
- In 'Add Target' -> select the newly created Lambda script from Step #3 above
- Click on 'Add configured Rule' and now map this rule in your Lambda script via AWS console
- Voila, it is done !!!