AWS Lambda Function to Update ECS Service
user_0659028
python
9 months ago
394 B
3
Indexable
import boto3
ecs_client = boto3.client('ecs')
def lambda_handler(event, context):
cluster_name = 'your-cluster-name'
service_name = 'your-service-name'
desired_count = event['desired_count']
response = ecs_client.update_service(
cluster=cluster_name,
service=service_name,
desiredCount=desired_count
)
return response
Editor is loading...
Leave a Comment