CodeshipViktor Farcic6 min readtutorialintermediate
Setting Up Jenkins EC2 Agents
Summary
The article walks through configuring Jenkins to launch EC2 instances as build agents on demand, covering AWS IAM setup, security groups, key pairs, AMI selection, and the Jenkins EC2 plugin configuration. It shows how idle termination can keep costs low while providing elastic build capacity.
- Create an IAM user with minimal required permissions and attach a policy (e.g., AdministratorAccess for demo) to let Jenkins manage EC2 resources.
- Define a security group opening port 22 (SSH) and generate an EC2 key pair to allow Jenkins to connect to agents.
- Select or build a custom AMI that includes Java (and optional tools) and record its AMI ID for the plugin configuration.
- Configure the Amazon EC2 cloud in Jenkins: add credentials, region, key pair, instance type, remote FS, labels, and set an appropriate idle‑termination timeout to balance startup latency vs cost.
DevOps engineers using Jenkins who need scalable, cost‑effective build agents on AWS should follow this guide to automate provisioning and teardown of EC2 workers.
5/10
