← Back to Index
Chapter 12 of 20

ECS & EKS Containers

Domain 3 — High-Performing Architectures (24%)
🐳
Question 1Scenario

A company wants to run containerised applications on ECS without managing or patching any EC2 instances. Which ECS launch type eliminates all server management?

Explanation

Fargate is a serverless compute engine for ECS and EKS. You specify CPU and memory for each task/pod, and AWS provisions, scales, and manages the underlying infrastructure. There are no EC2 instances to patch or manage. You pay per task based on CPU and memory requested. Ideal for microservices, batch jobs, and when you want to focus on applications, not infrastructure.

Question 2Knowledge

In Amazon ECS, what is a Task Definition?

Explanation

ECS Task Definitions are versioned blueprints for your containers. Each revision is immutable. A Task is a running instance of a Task Definition. An ECS Service maintains a desired number of running tasks and integrates with load balancers. The cluster is the logical boundary that groups tasks and services.

Question 3Scenario

A company has existing Kubernetes workloads on-premises and wants to migrate to AWS while retaining Kubernetes compatibility. AWS should manage the Kubernetes control plane. Which service should they use?

Explanation

EKS manages the Kubernetes control plane (API server, etcd, scheduler) across multiple AZs. Worker nodes can be EC2 instances (managed or self-managed node groups) or Fargate. EKS is certified Kubernetes conformant — existing Kubernetes manifests, Helm charts, and tools work without modification. This enables lift-and-shift of on-premises Kubernetes workloads.

Question 4Knowledge

Which AWS service provides a managed, private Docker container image registry for storing and distributing container images used by ECS and EKS?

Explanation

Amazon ECR is a fully managed container registry. It supports private repositories (access controlled by IAM) and public repositories (ECR Public Gallery). Images are stored in S3 and encrypted at rest. ECR integrates natively with ECS and EKS for seamless image pulls, and with AWS CodePipeline for CI/CD pipelines.

Question 5Scenario

ECS Fargate tasks need to retrieve database credentials from AWS Secrets Manager at runtime. What is the MOST secure way to grant this access?

Explanation

ECS Task Roles provide IAM permissions to the containers running in the task (via the container credentials endpoint at 169.254.170.2). The ECS Task Execution Role is different — it's used by ECS to pull images and publish logs. The Task Role is what the application code uses. This follows least privilege: each task gets only the permissions it needs.