Advanced 30 min read

Project: Deploy a Containerized Application

By the end of this lesson, you'll be able to:

  • Design a complete container deployment architecture applying every concept from this module
  • Explain why each component in the design is placed where it is, including IAM boundaries and observability
  • Apply this module's Cost & Cleanup discipline to a container-focused training project

Prerequisites: "Deployment and CI/CD Concepts on AWS"

This project is a design exercise

As with every hands-on project in this course, you can work through this entirely on paper, or build it in a real AWS account if you choose to, following the same two-valid-paths pattern every earlier project has used. QuarryDev itself does not deploy real infrastructure as part of this course — the scenario below is fictional, used to practice applying this module's concepts to something realistic.

The scenario: a QuarryDev Course API container deployment

A fictional "Course API" needs to run as a containerized, load-balanced application:

Developer
  → builds container image
  → pushes to ECR
  → ECS Service (Fargate launch type)
      → tasks spread across multiple subnets/AZs
  → behind an Application Load Balancer
  → reached by Users via Route 53

Application data lives outside the disposable containers, in whichever of RDS, DynamoDB, or S3 fits the actual data shape (Module 5's access-pattern-first reasoning still applies). Observability runs through CloudWatch (this module's Lesson 5). Permissions run through IAM roles (Module 2, applied throughout this module).

Designing every piece, and explaining why

Work through each component and be able to justify its placement:

  • Image: built from a Dockerfile, pushed to ECR — versioned and tagged, never containing baked-in secrets (Lesson 5).
  • Task definition: the blueprint specifying the image, CPU, and memory the Course API needs (Lesson 3) — not something running by itself.
  • Task / Service: the ECS service maintains the desired number of running tasks, replacing any that become unhealthy (Lesson 3).
  • Compute: Fargate supplies the compute capacity for those tasks, so no EC2 instances need direct management (Lesson 4) — the servers still exist; AWS operates them.
  • Networking: tasks placed across multiple subnets/Availability Zones (Module 6), with a Security Group allowing inbound only from the load balancer — never opened broadly.
  • Load balancer: an Application Load Balancer distributes traffic across healthy tasks and performs health checks (Lesson 3) — an unhealthy task stops receiving traffic.
  • IAM boundaries: the task's own IAM role (Lesson 5) grants only the specific permissions the Course API's code actually needs (for example, reading from a specific DynamoDB table) — never broad or account-wide access.
  • Storage/state: application data lives in RDS, DynamoDB, or S3 as appropriate — never relied upon to persist inside the container itself (Lesson 1).
  • Monitoring: CloudWatch logs and metrics for the service and its tasks (Lesson 5), so a failed deployment or an unhealthy task is visible quickly.
  • Deployment updates: a code change follows the full path from Lesson 5 — new image, new task definition revision, rolling deployment, health checks, old tasks replaced only once new ones are confirmed healthy.
  • Cost: Fargate compute, the load balancer, ECR storage, and CloudWatch logs each have their own independent cost story — review current pricing rather than assuming a small training deployment is free.

Cost & Cleanup

If any part of this was built in a real account, work through this checklist before considering the project finished — some of these have dependencies on each other, so order matters:

  1. Delete the ECS service first (scaling it down to zero tasks, then removing it), since other resources may depend on it still existing.
  2. Deregister old task definition revisions, if you no longer need them (deregistering doesn't delete the revision's history, but stops it from being usable for new deployments).
  3. Delete the ECS cluster, if it was created solely for this training exercise and nothing else uses it.
  4. Delete the load balancer and its target group(s).
  5. Delete the ECR repository and its images, once you're confident you don't need them.
  6. Delete the CloudWatch log groups created for this project, if you don't need to keep the logs.
  7. Delete the Security Groups and IAM roles/policies created solely for this project, once nothing still references them.
  8. Confirm nothing training-related remains by checking the ECS, ECR, load balancer, and IAM dashboards directly — the same "verify, don't assume" discipline every earlier module's project applied to its own resources.

Exercise

For the Course API deployment: (1) why does the task get its own IAM role instead of using broad account-wide permissions? (2) what should happen to application data instead of relying on the container's own local filesystem, and why? (3) walk through what happens, step by step, when a new version of the Course API is deployed. (4) list the cleanup order for the ECS service, the cluster, and the load balancer, explaining briefly why that order matters.

Show hint

Revisit Module 2 and Lesson 5 for the IAM question, Lesson 1 for the storage question, Lesson 5 for the deployment steps, and this lesson's Cost & Cleanup section for the ordering question.

Project: Deploy a Containerized Application Quiz

1. Why does the Course API's ECS task get its own narrowly-scoped IAM role rather than broad account-wide permissions?

2. An ECS service can maintain a desired number of running tasks.

3. A deployment update should build a new container image rather than manually patching a running container in place, a habit this course calls treating deployments as ______.

Show hint

It's the property this module's deployment lesson names directly — build once, deploy the same artifact everywhere.

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

This closing project ties the whole module together into one design exercise — a fictional QuarryDev Course API deployed as a load-balanced ECS service on Fargate, with the learner explaining the image, registry, task definition, task, service, networking, load balancer, health checks, IAM roles, storage, monitoring, deployment updates, and a full Cost & Cleanup checklist, entirely as a design exercise rather than an actual deployment.