Skip to content

Instantly share code, notes, and snippets.

@taross-f
Created May 13, 2020 09:18
Embed
What would you like to do?
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