# Micro Services at Bankin'  -  Deployment with Terraform

At Bankin', we trust our developers!

With one simple click, they can put their code into production and provision the ad hoc infrastructure in our cloud provider, Amazon.

To manage that, Bankin' use an infrastructure as code tool, **Terraform**.

***Terra.. what ?***

Terraform is a tool from HashiCorp, developed in Go, compatible with the most popular cloud providers (AWS, Google Cloud, Azure and many more).

Thanks to a proprietary language, HCL, you can describe your infrastructure from scratch. Terraform uses a state file to remember the current state of the infrastructure, and apply a diff each time the configuration change.

***Why use Terraform ?***

During our switch to micro services (read our article here), our needs in infrastructure and configurations increased exponentially.

Bankin' architecture is based on a group of clusters and services, which communicate together thanks to REST calls and messages.

To manage it, we were looking for a technology that can :

 - Create and update the infrastructure needed to run our stack  

\- Automate the maintenance tasks  

\- Provision on the fly new services  

Terraform do it all, and so much more! It's fast, reliable and new releases are available every few weeks.

**Terraform In Bankin'**

![](https://cdn.hashnode.com/uploads/covers/6a16bb46d064c7290d368f76/c8131806-030b-4918-bdc1-fca6f36f7f67.png align="center")

*Example of code to deploy a website*

Thanks to our in-house Jenkins, developers can specify needs and requirements of their services; including also the infrastructure. For example, a simple additional line to the JenkinsFile creates a full encrypted database linked to the service.

To accomplish that, we have updated our JenkinsFile with a new set of properties setting the architecture requirements.

![](https://cdn.hashnode.com/uploads/covers/6a16bb46d064c7290d368f76/7bf58dc2-6201-4ecf-9ba0-5736643e14b0.png align="center")

*A typical JenkinsFile at Bankin'*

During the Jenkins job execution, Terraform will be run and the desired infrastructure created.

![](https://cdn.hashnode.com/uploads/covers/6a16bb46d064c7290d368f76/617d81e6-f5f4-4446-9bab-c3e76d3164d7.png align="center")

Easy enough, isn't it?

Stay tuned for more info about the awesome tech we use at Bankin'!
