SAA-C03 ยท Containers and microservices
Moving applications into containers
Container images in Amazon ECR, task definitions, when to containerize a monolith versus rehost it on EC2 or refactor to Lambda.
Key points
- Push the image to a private Amazon ECR repository (aws ecr get-login-password); reference its URI in a task definition or manifest.
- ECR: lifecycle policies, scan on push, cross-Region and cross-account replication.
- Task execution role: agent pulls image, sends logs, fetches secrets.
- Task role: app code calls AWS.
- Containerize: process with packaged dependencies; rehost on EC2: fast, no changes, full OS; Lambda: short event-driven code.
Source: https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html
Practice questions
Which AWS service is a managed registry for storing private container images used by Amazon ECS and Amazon EKS?
- Amazon S3
- Amazon ECR
- AWS CodeCommit
- AWS Systems Manager
Show answer
Answer: B. Amazon ECR
Amazon ECR is AWS's managed container image registry with private repositories controlled by IAM. S3 stores objects but is not a registry that Docker pushes to, and CodeCommit and Systems Manager do not host images.
Which capabilities does Amazon ECR provide for private repositories?
- Lifecycle policies that clean up unused images
- Automatic refactoring of a monolith into microservices
- Vulnerability scanning of each image when it is pushed
- Replication of images to other Regions and accounts
- A built-in Kubernetes control plane for running images
Show answer
Answer: A. Lifecycle policies that clean up unused images, C. Vulnerability scanning of each image when it is pushed, D. Replication of images to other Regions and accounts
ECR offers lifecycle policies to expire unused images, scan on push to find software vulnerabilities, and cross-Region and cross-account replication. It does not rewrite code into microservices, and it does not run a Kubernetes control plane, which is Amazon EKS's job.
Application code running inside an ECS container can use the permissions of the task execution role to call AWS services such as Amazon S3.
Show answer
Answer: False
False. The task execution role's credentials go to the ECS container or Fargate agent and are not directly available to the containers. Code that calls AWS APIs needs a task role.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
