Question 24
Domain 3: Design High-Performing ArchitecturesSebuah perusahaan menjalankan aplikasi di **Amazon ECS dengan Fargate**. Mereka ingin memastikan bahwa jika satu task crash, task baru **otomatis di-launch** sebagai pengganti tanpa intervensi manual. Fitur ECS mana yang menjamin ini?
Correct answer: B
Explanation
Amazon ECS Service menjaga jumlah task yang diinginkan dengan “didefined desired count tasks” dan “otomatis replace task yang gagal untuk mempertahankan desired count.” Karena itu, saat satu task crash, service akan meluncurkan task baru tanpa intervensi manual.
Why each option is right or wrong
A. ECS Task Definition — definisikan restart policy di sana
B. **ECS Service** — mendefinisikan desired count tasks dan otomatis replace task yang gagal untuk mempertahankan desired count
Amazon ECS Service is the scheduler that enforces the task count declared in the service definition: if a task stops or crashes, ECS launches a replacement to restore the desired count, which is the behavior described in the ECS Service documentation. By contrast, a standalone task run with `RunTask` is not self-healing and will not be automatically replaced; the service is what provides the automatic recovery mechanism for Fargate tasks.
C. Auto Scaling Group — scale ECS tasks berdasarkan CPU
D. CloudWatch alarm yang trigger Lambda untuk restart task