Skip to content

Instantly share code, notes, and snippets.

@markilott
Created July 18, 2021 09:09
Show Gist options
  • Save markilott/378ce567213bd38d1c96b42910dcc777 to your computer and use it in GitHub Desktop.
Save markilott/378ce567213bd38d1c96b42910dcc777 to your computer and use it in GitHub Desktop.
Set desired task count to start/stop Fargate tasks
const AWS = require('aws-sdk');
const ecs = new AWS.ECS();
// Update the desired task count
await ecs.updateService({
service,
cluster,
desiredCount: 0, // 0 to stop, 1 (or more) to start
}).promise();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment