Created
May 13, 2020 09:18
-
-
Save taross-f/2a4468fe8bf4c4b0302807b7a1f941e7 to your computer and use it in GitHub Desktop.
stopStartFargate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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