/carbon-aware-serverless-jobs

How you can utilize servless services to decarbonize your batch jobs

Primary LanguageTypeScriptMIT LicenseMIT

Carbon Aware Serverless Jobs

This projects demonstrates how to decarbonize your batch jobs. It utilizes API's to find the the best execution time window with minimal grid carbon intensity and combines it with serverless AWS services.

The infrastructure is deployed using AWS CDK.

Architecture

architecturecarbonawareserverless

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npm run test perform unit tests
  • npm run cdk deploy deploy this stack to your default AWS account/region
  • npm run cdk diff compare deployed stack with current state
  • npm run cdk synth emits the synthesized CloudFormation template

What do I need in order to deploy this?

  1. An AWS account.
  2. An API key for https://carbon-aware-computing.com, see API-Docs
  3. Store API Key from Step 2 in your AWS accounts Parameter-Store with type=SecureString under the name /carbon-aware-computing/api-key

How do I deploy this?

  1. Install the latest LTS NodeJs or Nvm
  2. Clone this project
  3. Install dependencies using npm install
  4. Login to your AWS Account using the AWS CLI
  5. Deploy this cdk stack with npm run cdk deploy
  6. Execute the step function CarbonAwareServerlessCACBatchJobsScheduler