AWS Lambda Function to Update ECS Service
user_0659028
python
01/17/2025 12:19 PM
528 B
12
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