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.

  1. Create an IAM User:

    • Navigate to the AWS IAM ConsoleUsersAdd user.

    • Set the username as 3-tier-admin.

    • Select Programmatic access to enable API and CLI interactions.

  2. Attach Permissions:

    • Assign the AdministratorAccess policy to grant full permissions.

    • Alternatively, you can attach fine-grained EKS policies if needed.

  3. 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.

  1. Launch an EC2 Instance:

    • Go to the AWS EC2 ConsoleInstancesLaunch 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.).

  1. 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 and your-ec2-public-ip with the instance’s public IP.

AWS provides connection instructions for various operating systems, including methods like SSH, PuTTY, and others

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.

  1. Install Git (if not installed):

sudo apt update && sudo apt install -y git
  1. 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

By default, Docker requires root privileges. Add the user to the Docker group to provide the permissions.

sudo usermod -aG docker $USER

Last updated