AWS Lambda Function to Update ECS Service

 avatar
user_0659028
python
a month ago
394 B
1
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