Key Concepts
Launch Template
• A launch template stores the settings required to launch an EC2 instance (AMI, instance type, key pair, security groups, networking, storage, user data, etc.).
• Benefit → saves time because you don’t need to re-enter these parameters each time you create an instance.Instance Types
• EC2 instances come in families (General Purpose, Compute Optimized, Memory Optimized, etc.) with various sizes.
• Example: t2.micro = free tier eligible (1 vCPU, 1 GiB RAM), suitable for small workloads like Jenkins & Docker labs.Amazon Machine Image (AMI)
• A pre-configured OS + software package used to launch EC2 instances.
• Example: Amazon Linux 2 AMI → lightweight, secure, and maintained by AWS.
🛠️ Task 1 – Hands-On Steps
Step 1: Create a Launch Template
1. Go to AWS Console → EC2 → Launch Templates → Create launch template.
2. Provide:
• Name: jenkins-docker-template
• AMI: Amazon Linux 2
• Instance Type: t2.micro
• Key Pair: Select your existing key (or create one).
• Security Group: Allow SSH (22), HTTP (80), and Jenkins (8080).
• User Data (script): paste the script from Day 39 that installs Jenkins + Docker automatically.
User Data runs at launch, so your instance is ready with Jenkins & Docker pre-installed.
Step 2: Launch Instances from Template
1. Select your launch template → Actions → Launch instance from template.
2. Choose number of instances.
• You’ll see an option: Number of instances (set this to 3).
3. Review & Launch.
• AWS will create 3 identical instances (AMI + t2.micro + Jenkins + Docker setup).
Step 3: (Optional) Create an Auto Scaling Group (ASG)
1. Go to EC2 → Auto Scaling Groups → Create Auto Scaling group.
2. Select the launch template you just created.
3. Configure:
• VPC & subnets (choose default if unsure).
• Desired capacity: 3 (to start with 3 instances).
• Scaling policies: Add scale out (if CPU > 70%) and scale in (if CPU < 20%).
4. Attach a load balancer (optional, but recommended for production).
Now, AWS automatically manages the number of instances based on load
Top comments (0)