Day 58 โ€“ Lift and Shift: Deploying the VProfile Project to AWS

Today, I implemented the Lift and Shift migration strategy to move my VProfile application into AWS.
The goal was simple: move the project as-is from a local environment to AWS with minimal code changes, while keeping the same stack and architecture.


๐Ÿ”น Step 1 โ€“ Understanding the Lift and Shift Approach

Lift and Shift is a cloud migration strategy where you take an existing application, package it, and run it on the cloud without redesigning or refactoring.
This approach is fast, but requires careful configuration to ensure security, networking, and scalability.


๐Ÿ”น Step 2 โ€“ AWS Resources Setup

  1. Created AWS Key Pair โ€“ for SSH access to EC2 instances

  2. Configured Security Groups โ€“ allowing inbound/outbound rules for:

    • SSH (22)

    • HTTP (80)

    • HTTPS (443)

    • Custom ports for MySQL, RabbitMQ, Memcached, ElasticSearch

  3. Launched EC2 Instances โ€“ provisioned Amazon Linux / Ubuntu servers for each service

  4. Connected Frontend to Backend โ€“ via internal private IPs in the same VPC


๐Ÿ”น Step 3 โ€“ Load Balancer & Auto Scaling

  • Added Elastic Load Balancer (ELB) to distribute traffic across multiple Tomcat instances

  • Configured Auto Scaling Group to handle peak load and ensure high availability


๐Ÿ”น Step 4 โ€“ Stack Used

Prerequisites

  • JDK 17 or 21

  • Maven 3.9

  • MySQL 8

Technologies

  • Spring MVC

  • Spring Security

  • Spring Data JPA

  • Maven

  • JSP

  • Tomcat

  • MySQL

  • Memcached

  • RabbitMQ

  • ElasticSearch


๐Ÿ”น Step 5 โ€“ Database Setup

The VProfile project comes with a prebuilt MySQL dump file located at:

/src/main/resources/db_backup.sql

To import:

mysql -u <user_name> -p accounts < db_backup.sql

๐Ÿ”น Key Takeaways

โœ… Lift and Shift is a fast way to migrate applications to the cloud
โœ… Proper security group configuration is crucial to avoid open access
โœ… Using ELB + Auto Scaling ensures fault tolerance and scalability
โœ… AWS makes it easier to recreate complex local architectures in a managed cloud environment


๐Ÿ“Œ Next Step: I will start optimizing this deployment by introducing Re- Architecting Web App on AWS Cloud [PAAS & SAAS]

0
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir