Courseiva

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

Exhibit

Refer to the exhibit.

[container-definitions]
[
  {
    "name": "web",
    "image": "nginx:latest",
    "memory": 256,
    "cpu": 256,
    "essential": true,
    "portMappings": [
      {
        "containerPort": 80,
        "protocol": "tcp"
      }
    ]
  },
  {
    "name": "sidecar",
    "image": "myapp/sidecar:latest",
    "memory": 128,
    "cpu": 0,
    "essential": false
  }
]

Refer to the exhibit. A company has an Amazon ECS task definition with two containers. The 'web' container is essential, and the 'sidecar' container is not. The 'sidecar' container exits unexpectedly. What will happen to the task?

⚠ Common exam trap

The trap is that candidates assume any container failure stops the task, or that ECS restarts individual containers — the essential flag is the deciding factor and non-essential containers simply exit without task termination.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The task continues running as normal.

In an ECS task definition, only containers marked as essential cause the entire task to stop if they exit. Since the 'web' container is essential and the 'sidecar' container is not, the sidecar exiting does not stop the task; the task continues running with the web container unaffected.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The sidecar container will be marked as essential.

    Why it's wrong here

    Essential status is declared in the task definition at registration time; it is never assigned dynamically when a container exits. The sidecar's non-essential flag remains unchanged regardless of its exit code. Marking a container essential is a design decision made when authoring the task definition, not a runtime behaviour of ECS.

  • ✗

    ECS will automatically restart the sidecar container.

    Why it's wrong here

    ECS does not restart a non-essential container that exits; only the essential container's state governs the task. A non-essential container stopping is simply recorded, and the remaining containers continue running. Automatic restart applies to tasks managed by a service scheduler with a desired count, not to individual container exit within a running task.

  • ✓

    The task continues running as normal.

    Why this is correct

    Only essential containers determine task fate; a non-essential container exiting does not stop the task. Since the sidecar is marked non-essential, ECS leaves the web container and the task running, satisfying the stem's scenario where the sidecar exits unexpectedly.

  • ✗

    The ECS task will be stopped.

    Why it's wrong here

    ECS stops the entire task only when an essential container exits or fails. Because the sidecar is non-essential, its exit does not trigger task termination; the web container keeps running and the task remains in RUNNING state. Task stoppage would be the outcome had the essential web container exited instead.

About these practice questions

This SAP-C02 question is part of Courseiva's 984-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.