Projects

[VProfile] Improvement #1 - Cloud Lift and Shift

1. Project Overview:

This is an improvement on the latest version of the Vprofile project. Looking for a more flexible and reliable infrastructure and with no upfront payment (Pay as you Go), AWS seems to be the perfect solution.

To accomplish this, I used the “lift and shift” way to migrate the application to AWS Cloud, with fewer changes as possible.

2. Services Needed:

3. Project Structure:

VProfile LAS

Using good practice, I started off by setting up the Security Groups (SGs), Certificate Manager first. Then placed the backend, which is composed by MySQL, Memcached, and RabbitMQ into an EC2 Cluster. After that, was the EC2 instance with Tomcat and then the load balancer. Below, I'll show how this was made.

Two SGs: One for the ELB allowing all traffic, another for the Tomcat app, allowing only the ELB on port 8080.

VProfile LAS

Inbound rules to the backend security group

VProfile LAS

After it, the backend services: Ec2 Instances

And then the app server:

[App Layer] Creating the S3 Bucket via CLI

VProfile LAS

Build Artifact with Maven

VProfile LAS

Put it on a S3 bucket and then fetch to EC2 instances

VProfile LAS

[App Layer] Application Load Balancer

VProfile LAS

  • Auto-Scaling Group

    For the ASG it was necessary to create an AMI first, then setup a launch template, registering the proper roles and key pair for access. This is needed, because when the ASG notes that a new instance is going to be created, it will make it with the AMI.

    Creating Security Groups

    The main objective here is to set up configuration rules, so the services are correctly pointed to one another, and every port is in the right place. For this were created 3 security groups: one for the load balancer, one for the application instance (tomcat) allowing the ELB, and another for the backend instances (rabbitmq, memcached, mysql) allowing access from the app ELB, and from the services within its own security group.

  • SSH access were created on both app and backend, on port 22.

    Hosted zones with Route 53 (Private IP)

    VProfile LAS

    ELB Configuration HTTPS (Port 443)

    VProfile LAS

    Checking if DNS Name works

    VProfile LAS

    Load Balancer and AUTO SCALING Configuration
    AMI

    VProfile LAS

    Launch Template

    VProfile LAS

    Scaling Group

    VProfile LAS

    4. Dependencies:

    The applications dependencies were all received from the developers from this repository:
    https://github.com/hkhcoder/vprofile-project

    5. Testing:

    After everything set up, I used my own domain, with the Certificate Manager to access the application through the public internet (http: 80 / https: 443). The application was programmed for this particular project, so we could test the Memcached and MySQL, to check if it runs properly.

    VProfile LAS

    6. Troubleshooting:

    One of the mistakes I've been through this project was the domain, CNAME configuration, as Registro.br is not properly designed to make this particular kind of execution. I had to make some mistakes, and tests, until I could access the app through the domain.

    Hire Me For Your Project

    I would love to know how i can help.