[{"data":1,"prerenderedAt":68},["ShallowReactive",2],{"pattern-lambda-ecs-durable-python-sam":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":16,"extension":17,"framework":18,"gitHub":19,"highlight":6,"introBox":25,"language":32,"level":33,"meta":34,"patternArch":35,"resources":49,"s3URL":6,"services":6,"stem":63,"testing":64,"videoId":6,"__hash__":67},"patterns\u002Fpatterns\u002Flambda-ecs-durable-python-sam.json","AWS Lambda durable functions to Amazon ECS with Python",null,{"text":8},[9],"Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fmian-tariq.json",{"text":13},[14,15],"sam build","sam deploy --guided","Invoke ECS tasks from Lambda durable functions with automatic checkpointing, state management, and resilient execution patterns","json","AWS SAM",{"template":20},{"repoURL":21,"templateURL":22,"projectFolder":23,"templateFile":24},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-ecs-durable-python-sam","serverless-patterns\u002Flambda-ecs-durable-python-sam","lambda-ecs-durable-python-sam","template.yaml",{"headline":26,"text":27},"How it works",[28,29,30,31],"This pattern demonstrates AWS Lambda durable functions invoking Amazon ECS tasks with resilient, long-running execution capabilities:","1. Durable Synchronous Pattern: Lambda uses checkpointed steps and durable waits to poll ECS task status. Can run for up to 1 year with automatic recovery from failures. No compute charges during wait periods.","2. Durable Callback Pattern: Lambda uses checkpointed steps to reliably initiate ECS tasks. Each step (create record, start task, update status) is automatically checkpointed for guaranteed execution.","The pattern uses the AWS Durable Execution SDK for Python, providing automatic state management, checkpoint-based recovery, and cost-effective long-running workflows. Includes inline Python code in ECS containers, and VPC networking,","Python","300",{},{"icon1":36,"icon2":41,"line1":45},{"x":37,"y":38,"service":39,"label":40},20,50,"lambda","AWS Lambda durable function",{"x":42,"y":38,"service":43,"label":44},80,"ecs","Amazon ECS",{"from":46,"to":47,"label":48},"icon1","icon2","Sync or Callback",{"bullets":50},[51,54,57,60],{"text":52,"link":53},"Lambda durable functions","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fdurable-functions.html",{"text":55,"link":56},"Durable Execution SDK","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fdurable-execution-sdk.html",{"text":58,"link":59},"Run Amazon ECS or Fargate tasks","https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fecs_run_task.html",{"text":61,"link":62},"Amazon ECS Task Definitions","https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask_definitions.html","patterns\u002Flambda-ecs-durable-python-sam",{"text":65},[66],"See the GitHub repo for detailed testing instructions.","6mlTJHtRWG9rVxaaRaHjQ-WW10eQ_lAa8Dn7IQG29ak",1778846886134]