5 Discovering Jenkins as Code with Terraform
This chapter covers
- Overview of Infrastructure as Code (IaC).
- Usage of Terraform and how it enables IaC.
- Deployment of Jenkins in a secure private network.
- Scaling Jenkins workers dynamically with AWS Autoscaling.
In the previous chapter, we have used HashiCorp Packer to create custom Jenkins machine images; in this chapter, we will use those images (figure below) to deploy the machines. The only difference, we will write declarative definitions of the Jenkins infrastructure we want to exist and use an automation tool to deploy the resources on the given Infrastructure as a Service (IaaS) provider.
In the past, managing IT infrastructure was a hard job. System administrators had to manually manage and configure all of the hardware and software that was needed for the applications to run. However, in recent years, things have changed dramatically. Trends like cloud computing revolutionized—and improved—the way organizations design, develop, and maintain their IT infrastructure. One of the critical components of this trend is called infrastructure as code.