/scheduler-api

Scheduler API that interfaces with Dynamodb

Primary LanguageTypeScript

Topcoder AutoPilot - Schedule API

This API is part of the Scheduler Processor -> Schedule API -> Schedule Executor triage of modules. This module is responsible to create the events in AWS Step functions, which are later executed by the Executor

Development status

Total alertsLanguage grade: JavaScript

Deployment status

Dev: CircleCI Prod: CircleCI

Requirements

Environment Variables

  • TABLE_NAME: The name of the dynamodb table
  • STATE_MACHINE_ARN: The ARN of the schedule executor
  • S3_BUCKET: The bucket name of the swagger file
  • LAMBDA_ROLE: Lambda function's execution role
  • REGION : Region name where API will run.
  • DYNAMODB_REGION: Region name where Dynamodb will run.

Note: Create a .env file in root folder then add these three configs.

Deploy

npm install
npm run deploy

Destroy instances

WARNING This will destroy all resources created in the earlier npm run deploy step

Run npm run destroy to clean up AWS resources.

It will NOT delete the Table nor the S3 Bucket resources

Notes

  • scheduleTime cannot be longer than 1 year.
  • It's allowed to use past date for scheduleTime and it will execute immediately. It's better to omit validation because of network delays. For example: submit a request with date "now +2 seconds", it can fail if there are e.g. network delays.