CASESTUDY

To automate creating AWS resources using Terraform

Terraform is an open-source infrastructure-as-code tool for automating and managing cloud and on-premises infrastructure using configuration files

About The Company

The Company is an American multinational financial services company, headquartered in Denver, Colorado. It Serving millions of retail and digital customers every day with franchise in over 200 countries and territories.

The Challenge

The client initially created the necessary resources via the AWS console. Running the process became a difficult undertaking as the number of these resources and their interaction grew.

The Solution

The answer is to use terraform. Infrastructure may be built, modified, and versioned effectively and safely with Terraform. In addition to managing specialised internal solutions, Terraform can handle well-known and established cloud service providers. Based on the descriptive information from several *.tf files, Terraform will operate. When Terraform is launched, it will read every *tf file and assemble them in the correct sequence.

Details

Files and Directories
  1. Terraform configuration files, which have a standard organisation of files and directories and enhance code readability, make up the bulk of the code.
  2. Terraform modules are top-level directories.
  3. For the client, the parent-child module pattern is used.
  4. The module contains maily three Terraform configuration files: main.tf, variable.tf and output.tf. These are known as root modules aka parent module.
  5. The Root module can call other child modules from either local directories or Terraform Registry or from anywhere in the disk.
  6. The child module contains files such as main.tf, variable.tf and output.tf as shown in figure.
  7. Once all the tf files are ready, can create the resources. Client decided which files to be created. The plan is like a dry run. The apply will create the resources.
The Benefits
  1. The client is able to create the resources over multiple public clouds within a very short time span (matter of minutes).
  2. The client has the flexibility to create the resourse as and when needed.
  3. The state of Terraform makes debugging simple and enables for the tracking of changes over the course of deployments.
  4. Organizations often utilise outdated click-ops deployment techniques that take days or even weeks and are prone to mistakes. Full deployment with Terraform can happen in a matter of minutes.