CI/CD with Jenkins pipeline: managing infrastructure with Terraform and Docker

Click for: original source

An article by Alexander Savchuk in which he continues his series on CI/CD with Jenkins. This blog post attempts to document some of the lessons we learned during their two-year journey with Terraform.

Terraform is really easy to start using for a “Hello world” type of project on a local machine, but the learning curve steepens quite significantly when we start thinking about multiple environments and more complex infrastructure configurations.

The article provides:

  • System overview
  • Project layout
  • Typical deployment
  • Preventing configuration drift
  • Separating application and infrastructure deployments
  • Wrapping up with Docker

Running Terraform deployments in Docker has an added benefit of isolating dependencies specific to each project.

It’s important to be able to run Terraform locally to test your changes when you are developing some infrastructure code. To achieve this, they encapsulate Terraform core along with all providers, external data sources, and wrapper scripts in a Docker image. Excellent read!

[Read More]

Tags docker devops containers web-development