title: AWS ECS EC2 Rolling Updates - Insufficient CPU units available
body: <p>I am running one AWS ECS Service with two tasks (they are same) and one container per task. I would like to know, how to properly manage rolling updates?</p>
  <p>As per information, I found inside AWS docs, a rolling update is the default option.</p>
  <p>Task and services are described inside Terraform and I do update via <code>aws cli</code>:</p>
  <pre><code>aws ecs update-service --cluster $(ECS_CLUSTER) --service $(ECS_SERVICE) --force-new-deployment --task-definition $(ECS_TASK_DEFINITION)
  </code></pre>
  <pre><code>Task configuration:
  +-------------+---------+
  | Task memory | 900 MiB |
  +-------------+---------+
  | Task CPU    |   900   |
  +-------------+---------+
  Container configuration:
  +-------------+---------+
  | CPU         |   256   |
  +-------------+---------+
  | Hard limit  | 900 MiB |
  +-------------+---------+
  | Soft limit  | 512 MiB |
  +-------------+---------+
  </code></pre>
  <p>For this cluster I have registered one t3a.small instance, so available resources are following:</p>
  <ul>
  <li>CPU: <strong>2048</strong> units</li>
  <li>Memory: <strong>1961</strong> MiB</li>
  </ul>
  <p>This is suitable for running two tasks, however I am facing issues during deployment:</p>
  <blockquote>
  <p>Service web was unable to place a task because no container instance met all of its
  requirements. The closest matching container-instance 123123123 has insufficient CPU units
  available. For more information, see the Troubleshooting section.</p>
  </blockquote>
  <p>Service deployment is configured like this:</p>
  <ul>
  <li><strong>Minimum healthy percent 50</strong></li>
  <li><strong>Maximum percent 200</strong></li>
  </ul>
  <p>So my guess was, one service will be killed and the other one will be updated, however I am receiving this error instead.</p>
  <p>How this should be configured correctly?</p>