Back to devops
devops#aws#ec2#devops#infrastructure

CI/CD Project Part 1: Provision AWS Infrastructure

Six Ubuntu VMs, one security group, ready for Kubernetes and Jenkins. Step-by-step in the AWS console.

TechNotesHub Team August 2, 2026 2 views
Log in to download the attached PDF

Part 1 — AWS Infrastructure

What we're building

Six EC2 instances, all in the same VPC and same security group so they can talk on the private network.

#NameInstance typePorts to open
1k8s-mastert2.medium22, 6443 (API), 10250
2k8s-worker-1t2.medium22, 10250, 30000-32767
3k8s-worker-2t2.medium22, 10250, 30000-32767
4jenkinst2.medium22, 8080
5nexus-sonart2.medium22, 8081 (Nexus), 9000 (SonarQube)
6monitort2.medium22, 9090 (Prom), 3000 (Grafana)

Step-by-step

1. Log into AWS console → EC2

Pick region ap-south-1 (Mumbai) or the closest to you.

2. Create one security group first

Security Groups → Create → name it devops-project-sg.

Inbound rules (start permissive for the lab; tighten later):

TypeProtocolPortsSource
SSHTCP22Your IP
Custom TCPTCP6443Anywhere-IPv4
Custom TCPTCP10250devops-project-sg (self)
Custom TCPTCP30000-32767Anywhere-IPv4
Custom TCPTCP8080Anywhere-IPv4
Custom TCPTCP8081Anywhere-IPv4
Custom TCPTCP9000Anywhere-IPv4
Custom TCPTCP9090Anywhere-IPv4
Custom TCPTCP3000Anywhere-IPv4

3. Launch 6 instances

Instances → Launch Instances, then for each server:

  • AMI: Ubuntu Server 22.04 LTS
  • Instance type: t2.medium
  • Key pair: create/use one .pem
  • Security group: pick devops-project-sg
  • Volume: 15 GB gp3 (enough for tools + logs)
  • Tags: Name = k8s-master (etc.)

4. SSH into each

chmod 400 devops.pem
ssh -i devops.pem ubuntu@<public-ip>
sudo hostnamectl set-hostname k8s-master   # do this per box

5. Enable password auth for Jenkins (optional lab shortcut)

sudo sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
sudo passwd ubuntu
sudo systemctl restart ssh

Real-world note

In production this whole file becomes Terraform. For the lab, clicks are fine, but writing a main.tf that creates these 6 boxes + SG + key pair is an excellent résumé line.

Cost heads-up

6 × t2.medium ≈ ₹0.05/hour × 6 ≈ ₹9/hour for the lab. Stop the instances when you finish for the day; terminate at the end of the project. Set a billing alarm at ₹500 in CloudWatch. You've been warned.

Keep reading

You may also like

Discussion (0)

No comments yet. Be the first to weigh in.

Leave a comment

Comments are reviewed before appearing.