Skip to content

Instantly share code, notes, and snippets.

@markilott
markilott / scheduler-fnc-cdk.js
Created July 18, 2021 09:20
CDK - Lambda Function to start/stop ECS services
// In the Scheduler Stack ===========================================
// Lambda Function to start/stop tasks
const ecsScheduleFnc = new Function(this, 'ecsScheduleFnc', {
description: 'Lambda ECS Service Mgt Function',
functionName: 'ecsScheduleFnc',
runtime: Runtime.NODEJS_14_X,
handler: 'index.handler',
timeout: Duration.seconds(5),
code: Code.fromAsset(`${__dirname}/lambda/manage-task`),
});