Getting Started
IAM Configuration, Initialization of EC2 instance on AWS and cloning the project repository to prepare for deployment.
IAM Configuration
To manage AWS resources securely, we first need to create an IAM user with the necessary permissions to interact with EKS (Elastic Kubernetes Service) and other AWS services.
Create an IAM User:
Navigate to the AWS IAM Console → Users → Add user.
Set the username as 3-tier-admin.
Select Programmatic access to enable API and CLI interactions.
Attach Permissions:
Assign the AdministratorAccess policy to grant full permissions.
Alternatively, you can attach fine-grained EKS policies if needed.
Generate Security Credentials:
After creating the user, go to Security Credentials.
Click on Create access key and note down the Access Key ID and Secret Access Key.

These credentials will be used to authenticate AWS CLI commands for managing the EKS cluster and deployments.
Initialization of AWS EC2 instance
To deploy the three-tier application, we need to set up an EC2 instance that will act as the deployment environment.
Launch an EC2 Instance:
Go to the AWS EC2 Console → Instances → Launch Instance.
Set the instance name (e.g.,
ThreeTierApp-Instance
).Choose Ubuntu 22.04 LTS as the AMI (or any preferred Linux-based AMI).
Select an instance type (e.g.,
t2.Large
for better performance).Create or use an existing key pair for SSH access.
Configure security groups to allow required ports (22 for SSH, 80 for HTTP, 3000, 8080,, etc.).

Connect to the EC2 Instance:
Once the instance is running, use SSH to connect:
ssh -i your-key.pem ubuntu@your-ec2-public-ip
Replace
your-key.pem
with your private key andyour-ec2-public-ip
with the instance’s public IP.
This instance will serve as the foundation for deploying and running your application. 🚀
Cloning the Repository
After initializing the EC2 instance, the next step is to clone the project repository to set up the application.
Install Git (if not installed):
sudo apt update && sudo apt install -y git
Clone the Repository:
Navigate to the desired directory and run:
git clone https://github.com/LondheShubham153/TWSThreeTierAppChallenge.git
cd TWSThreeTierAppChallenge
With the repository cloned, you are now ready to set up Docker and deploy the application. 🚀
Installing Docker
sudo apt update
sudo apt install -y docker.io
docker --version
Start and enable the Docker service:
systemctl enable docker
sudo usermod -aG docker $USER
Using sudo
for every Docker command is not a good practice as it can be inconvenient and pose security risks. The better approach is to add the user to the Docker group so that Docker commands can be run without requiring sudo
.
Last updated