Skip to content

Instantly share code, notes, and snippets.

@taross-f
Created May 13, 2020 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taross-f/2a4468fe8bf4c4b0302807b7a1f941e7 to your computer and use it in GitHub Desktop.
Save taross-f/2a4468fe8bf4c4b0302807b7a1f941e7 to your computer and use it in GitHub Desktop.
stopStartFargate.py
import json
import boto3
def lambda_handler(event, context):
print(event)
client = boto3.client('ecs')
clusters = event['clusters']
for cluster in clusters:
services = cluster['services']
for service in services:
res = client.update_service(
cluster=cluster['name'],
service=service['name'],
desiredCount=service['desiredCount'])
print(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment