Study Guide845 words

AWS Migration Guide: Transitioning Applications to Containers

How to migrate applications into containers

AWS Migration Guide: Transitioning Applications to Containers

This guide covers the strategies, services, and best practices for migrating legacy applications into a containerized environment on AWS, specifically focusing on ECS, EKS, and Fargate.

Learning Objectives

After studying this guide, you should be able to:

  • Differentiate between various migration strategies (Rehosting vs. Replatforming).
  • Identify the appropriate AWS container service (ECS vs. EKS) based on organizational needs.
  • Evaluate the benefits of serverless container execution with AWS Fargate.
  • Select the correct AWS tools for tracking and executing a server-to-container migration.
  • Describe how hybrid container environments work using ECS/EKS Anywhere.

Key Terms & Glossary

  • Containerization: The process of packaging an application and its dependencies together into an image that runs isolated on an OS.
  • Orchestration: The automated management, scaling, and deployment of containers (e.g., ECS, Kubernetes).
  • Microservices: An architectural style that structures an application as a collection of small, loosely coupled services.
  • AWS Fargate: A serverless compute engine for containers that works with both ECS and EKS.
  • Sidecar Pattern: A design pattern where a secondary container is attached to a primary application container to provide supporting features like logging or monitoring.
  • Docker: The industry-standard platform used to create, deploy, and run applications in containers.

The "Big Idea"

[!IMPORTANT] The primary goal of migrating to containers is portability and consistency. By abstracting the application from the underlying infrastructure, organizations can achieve "write once, run anywhere" capabilities, ensuring that the application behaves identically in development, testing, and production environments while enabling rapid horizontal scaling.

Formula / Concept Box

FeatureAmazon ECSAmazon EKSAWS Fargate
Best ForSimplicity, deep AWS integrationKubernetes-native apps, hybrid cloudHands-off infra management
Control PlaneManaged by AWSManaged by AWSManaged by AWS
Data PlaneEC2 or FargateEC2 or FargateFully Serverless
ScalingFast, AWS-nativeKubernetes HPA/VPAAutomatic, per-task

Hierarchical Outline

  1. Migration Strategies
    • Rehosting (Lift-and-Shift): Moving VMs to EC2 using AWS Application Migration Service.
    • Replatforming (Lift-and-Reshape): Containerizing the app to run on ECS or EKS without major code changes.
    • Refactoring: Architecting for microservices and serverless (Lambda/Fargate).
  2. AWS Container Orchestration
    • Amazon ECS: Proprietary AWS orchestrator; highly integrated with IAM and CloudWatch.
    • Amazon EKS: Managed Kubernetes; best for those moving from on-premises K8s.
  3. Migration Discovery & Planning
    • AWS Migration Hub: Central dashboard for tracking migration status.
    • Application Discovery Service: Collects server utilization and dependency mapping.
  4. Hybrid & Local Deployments
    • ECS/EKS Anywhere: Running AWS-managed containers on your own local hardware.
    • EKS Distro: Open-source distribution of EKS for manual installation.

Visual Anchors

Migration Workflow

Loading Diagram...

ECS Resource Hierarchy

\begin{tikzpicture}[node distance=2cm, every node/.style={rectangle, draw, rounded corners, minimum width=3cm, minimum height=1cm, align=center}] \node (cluster) [fill=blue!10] {Cluster$Logical Grouping)}; \node (service) [below of=cluster, fill=green!10] {Service$Maintains desired count)}; \node (task) [below of=service, fill=orange!10] {Task Definition$Blueprint: Image, CPU, RAM)}; \node (container) [below of=task, fill=red!10] {Container$Running Instance)};

\draw [->, thick] (cluster) -- (service); \draw [->, thick] (service) -- (task); \draw [->, thick] (task) -- (container); \end{tikzpicture}

Definition-Example Pairs

  • Task Definition: A text file (JSON) that describes one or more containers that form your application.
    • Example: Specifying that your application needs 512MB of RAM and should use the nginx:latest image from ECR.
  • AWS Application Migration Service (MGN): A service that automates the conversion of source servers to run on AWS.
    • Example: Replicating a physical Windows Server 2016 from a local data center and launching it as an EC2 instance in a VPC.
  • Stateless Workload: An application that does not store client data between sessions on the server.
    • Example: A web front-end container where any user request can be handled by any available container instance.

Worked Examples

Scenario: Migrating a Legacy Java App to ECS

  1. Preparation: Use AWS Application Discovery Service to find dependencies (e.g., an Oracle Database the app talks to).
  2. Database Migration: Use AWS DMS (Database Migration Service) to move the Oracle data to Amazon Aurora.
  3. Containerization: Create a Dockerfile for the Java app, build the image, and push it to Amazon Elastic Container Registry (ECR).
  4. Deployment:
    • Create an ECS Cluster.
    • Define a Task Definition pointing to the ECR image.
    • Set up an ALB (Application Load Balancer) to route traffic.
    • Launch the tasks using the Fargate launch type to avoid managing EC2 instances.

Checkpoint Questions

  1. Which service allows you to track the progress of various migration tasks from different AWS tools in one place?
    • Answer: AWS Migration Hub.
  2. What is the primary difference between ECS and EKS?
    • Answer: ECS is an AWS-native proprietary orchestrator, while EKS is a managed version of the open-source Kubernetes platform.
  3. True or False: Using Fargate requires you to manage the underlying EC2 instances and OS patching.
    • Answer: False. Fargate is serverless; AWS manages the underlying infrastructure.
  4. When should a company use ECS Anywhere?
    • Answer: When they need a consistent tooling experience for containers across both AWS cloud and their own on-premises data centers (often for regulatory or latency reasons).
  5. What tool is specifically recommended for "lift-and-shift" migrations to AWS?
    • Answer: AWS Application Migration Service (formerly CloudEndure).

Ready to study AWS Certified Solutions Architect - Associate (SAA-C03)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free