In this workshop, you will learn how to deploy EC2 instances securely inside private subnets within an Amazon VPC. We will set up two EC2 instances named rookwork-ec2-1 and rookwork-ec2-2 within the private subnets of your custom VPC. You will configure their network settings to ensure they remain isolated from direct public internet access, and verify the environment configuration (local IP, internet route via NAT Gateway, and installation of key dependencies such as Docker, Node.js, and Git).
rookwork-ec2-1 in the Name field.
Rookwork-VPC).rookwork-private-subnet-1).

rookwork-ec2-2.rookwork-private-subnet-2) for high availability across different Availability Zones.
Since both EC2 instances are in private subnets, they do not have public IP addresses and cannot be accessed directly via SSH from the public internet. We will connect to the instance using AWS Systems Manager (SSM) Session Manager.
rookwork-ec2-2) and click the Connect button at the top right.

Once the terminal session is successfully established, execute the following verifications:
To ensure the route table for private subnets redirects outbound traffic to a NAT Gateway (enabling packages to be updated and library downloads):
ping -c 3 google.com

Run version check commands to ensure the required runtimes and tools for the Rookwork application are installed and ready:
Docker:
docker --version
If not installed, run the following commands to install:
sudo dnf update -y
sudo dnf install -y docker
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER
Node.js:
node --version
If not installed, run the following commands to install via NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 20
Git:
git --version
If not installed, run the following command to install:
sudo dnf install -y git