🚀Unlocking the Power of AWS: Migrating Your Web App to AWS with Lift and Shift: A Step-by-Step Guide (part-1)

Sowmiya Shankar
6 min readNov 9, 2023

🌈Introduction:

🚀 In this blog post, I will provide a comprehensive, step-by-step guide on how to set up a web application stack on AWS, using the “Lift and Shift” strategy. If you’re new to the concept, “Lift and Shift” is a migration approach that enables you to transfer your existing on-premises applications to the cloud with minimal modifications. It’s like moving your setup to AWS without major changes, facilitating a swift transition to the cloud. ✈

🌈Scenario:

🔍 Now, let’s take a closer look at the situation. Imagine you have various application services like MySQL (a database), Tomcat (a web server), and DNS (domain name system) running on either physical or virtual machines. To keep everything running smoothly, you need several teams working around the clock. These teams handle different aspects, including virtualization, data center operations, monitoring, and system administration.

🕒 This arrangement is complicated, 💰 expensive, and time-consuming, especially when you have to adjust the resources frequently — like when you need to expand to handle more users or scale down during quieter times. 📈📉

🌈Solution:

💡 The solution to this problem is to leverage cloud computing, specifically AWS. Instead of running your workloads in your own data center, you can run them on AWS, paying only for the resources you use. This approach provides:

🌟 Flexibility: You can easily adjust your resources as needed.

🚀 Elasticity: Your setup can automatically adapt to changes in demand.

💰 Cost Control: Pay only for what you use, managing your budget effectively.

đŸ€– Automation: Streamline tasks, save time, and reduce errors.

This simplifies infrastructure management, allowing you to focus on your application and users without the hassle of handling hardware and resources.

🌈Architectural Workflow:

â–ȘIn this project, we’ll utilize AWS services such as EC2 instances, Elastic Load Balancer, Auto Scaling, S3 for storage, Amazon Certificate Manager, and Route 53.

â–ȘIn a previous blog, I shared a step-by-step guide on setting up a multi-tier web application, both manually and through automation, on local machine with complete architectural workflow explanation. If you haven’t had a chance to read my previous blogs, please check it out below links.

Part 1: https://medium.com/cloudnloud/empower-your-devops-skills-setting-up-multi-tier-web-apps-locally-4753beef4d55

Part 2: https://medium.com/cloudnloud/empower-your-devops-skills-setting-up-multi-tier-web-apps-locally-4753beef4d55

â–ȘNow, we’re about to embark on a new journey to migrate the same application from our local server to the AWS cloud. To achieve this, we’ll be employing a “lift and shift” strategy. When you have a web stack on AWS Cloud, the architectural design will look like this.

Image source: Imran Teli Udemy DevOps projects

📌User Access and GoDaddy DNS:

· Users access your website through a URL, which is associated with a specific endpoint.

· This association is typically managed through DNS (like GoDaddy), which translates the user-friendly URL into an IP address that points to your application.

📌HTTPS Encryption and ACM:

· You correctly state that HTTPS is used to secure the communication between users and your website.

· SSL/TLS certificates for HTTPS encryption are indeed managed using Amazon Certificate Manager (ACM).

📌Load Balancer:

· You have an Application Load Balancer (ALB) that directs incoming traffic.

· The ALB enforces HTTPS and routes incoming requests to your Apache Tomcat instances.

📌Auto Scaling:

· Auto Scaling group to manage the capacity of your Tomcat instances.

· The group can automatically adjust the number of instances based on the traffic load, ensuring your application can handle increased demand.

📌Security Groups:

· Security groups are used to control inbound and outbound traffic for your instances.

· The ALB’s security group allows only HTTPS traffic, which is a good security practice.

· Tomcat instances are in a separate security group that allows traffic on Port 8080, but only from the ALB. This restricts direct access to these instances.

📌Backend Services:

· Your application relies on backend services, including MySQL, Memcache, and RabbitMQ.

· The IP addresses of these services are stored in a Route 53 private DNS zone. This setup helps your Tomcat instances find and communicate with the backend services.

📌DNS Resolution:

· The Tomcat instances use the names mentioned in Route 53’s private DNS zone to locate and connect to the backend servers. It’s like a phone book for your application’s internal services.

📌Security for Backend Services:

· You mentioned that backend service instances have their own security groups. This is good practice to ensure that only authorized traffic can access these services.

🌈Flow of Execution:

  1. Begin by logging into your AWS account.
  2. Create key pairs to ensure secure access.
  3. Configure security groups according to your specific requirements.
  4. Launch instances using Bash scripts, automating the setup process.
  5. Update IP-to-name mappings in Route 53 for easy DNS resolution.
  6. Build your application from source code to prepare it for deployment.
  7. Upload your application artifacts to an S3 bucket for easy access.
  8. Download these artifacts to your Tomcat EC2 instances, ensuring that the necessary resources are readily available.
  9. Set up an Elastic Load Balancer with HTTPS, securing it with ACM certificates.
  10. Map the Load Balancer’s endpoint to your website’s name in GoDaddy’s DNS settings for seamless accessibility.
  11. Verify that your application runs smoothly and efficiently.
  12. Finally, implement an Auto Scaling group for your Tomcat instances to ensure optimal performance and resource allocation.

🌈Prerequisites:

Before we start this exciting journey, there are a few things you’ll need to have in place:

📌AWS Account: If you don’t already have an AWS account, it’s easy to create one.

📌Domain Name: You’ll need a domain name, which is your web address. You can acquire one through services like Route 53, GoDaddy, or any other domain providers you prefer.

📌ACM Certificate: To secure your website with HTTPS, you’ll require an ACM (Amazon Certificate Manager) certificate.

If you’re not sure how to create a certificate using ACM for HTTPS protocol, don’t worry — I’ll provide you with the steps. In my case, I already purchased a domain name from GoDaddy.

  1. First, go to the AWS console and search for ACM. Once you’re on the ACM page, click on ‘Request a Public Certificate.’ This page will look like the screenshot below. Enter your domain name, choose your preferred validation method, and click the ‘Request’ button.

2. After clicking ‘Request,’ you’ll receive CNAME and CNMAE values as shown in the screenshot. At this stage, the certificate status will be ‘Pending Validation.’

3. In your domain account with GoDaddy (or any other domain registrar where you purchased your domain), there should be a section for managing your domain settings. Enter the CNAME and values as shown below.

4. When you request a certificate using ACM (Amazon Certificate Manager) for your domain, the certificate needs to be validated to ensure that you have control over the domain. This validation can take some time, and once it’s completed and approved, you’ll see in your ACM page that AWS has issued the certificate.

Once we’ve ensured the prerequisites, we’ll proceed to set up a multi-tier web application stack on AWS cloud using the ‘Lift and Shift’ strategy.”

Stay tuned for my upcoming blog, where I’ll provide you with a step-by-step, hands-on walkthrough of the entire process. We’ll dive into practical, actionable steps that will empower you to set up your web application stack on AWS with confidence. Until then, keep your learning spirit high, and get ready to embark on an exciting adventure in the world of AWS. đŸš€đŸ› ïž

🌟🌟Happy learning! 🌟🌟

--

--