Bitzu

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

Single choice

Which AWS service is a managed registry for storing private container images used by Amazon ECS and Amazon EKS?

  1. Amazon S3
  2. Amazon ECR
  3. AWS CodeCommit
  4. 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.

Select all that apply

Which capabilities does Amazon ECR provide for private repositories?

  1. Lifecycle policies that clean up unused images
  2. Automatic refactoring of a monolith into microservices
  3. Vulnerability scanning of each image when it is pushed
  4. Replication of images to other Regions and accounts
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module