title: AWS Lambda invoking Fargate task
body: <p>I am new to AWS and experimenting with AWS Lambda and Fargate. I have a long-running process that I have defined as an AWS Fargate containerized task. This task is triggered using <code>ecs.runTask(taskParams, callback)</code> api call from an AWS Lambda function. The Lambda function is triggered by a notification of a file uploaded into an S3 bucket.</p>
  <blockquote>
  <p>You can now configure your AWS Lambda functions to run up to 15
  minutes per execution. Previously, the maximum execution time
  (timeout) for a Lambda function was 5 minutes. (Source: <a href="https://aws.amazon.com/about-aws/whats-new/2018/10/aws-lambda-supports-functions-that-can-run-up-to-15-minutes/" rel="nofollow noreferrer">Amazon</a>)</p>
  </blockquote>
  <p>My question is, does <code>ecs.runTask()</code> run the task asynchronously inside an on-demand container without the lambda function that triggered it waiting for its completion? Does that explain how the lambda function is no longer bound by the task running time? Is this a recommended approach for long-running processes where we don't want an ECS instance just around?</p>
  <p>Finally, what is the difference between <code>ecs.runTask()</code> and <code>ecs.startTask()</code> api calls?</p>