Deploying the Vue/JS web application in a multi-tier, highly available deployment architecture in AWS
Create four subnets - two public and two private (VPC)
Configure AWS Systems Manager to allow SSM access to VMs
Deploying a NAT gateway in one of the public subnetsÂ
Create custom routing for private subnets to direct traffic to gateway
Create an instance template for repeatable deployments. Assign SSM-enabled role to instance profile.
Launch two EC2 instances using the template, one in each of the private subnets
Create a target group, covering the two instances on port 80
Update VMs, install and configure apache2
Check out web site content from github
Launch Application Load Balancer, listening to public URL, routing to target group
Visualize the data using Vue/JS as previously
172.31.92.142 - - [30/Jan/2024:18:45:02 +0000] "GET /ok/index.html HTTP/1.1" 200 279 "-" "ELB-HealthChecker/2.0"
172.31.5.92 - - [30/Jan/2024:18:45:02 +0000] "GET /ok/index.html HTTP/1.1" 200 279 "-" "ELB-HealthChecker/2.0"
End result: Within a few hours, I could deploy a highly available web application using this multi-tier architecture. Web servers are in private subnets, protected from external access and available only via Session Manager or a bastion host, but with internet access via NAT gateway.
Baseline cost for this deployment is low, and it can easily be scaled out to more nodes, availability zones.
An option to consider would be deploying the webapp into a container image and running in Kubernetes.