Terraform: Infrastructure as Code

A tool to help your business scale
to meet demand

Your business depends on infrastructure, and the larger your business grows, the more you have to scale the infrastructure. Growth demands scale to a point where the number of components to make it possible can become overwhelming. Couple that with the teams involved with making such growth happen and the complications continue to mount. 

That’s why you need to employ the right tools to make scaling not only possible but seamless and (almost) effortless. That means you’re looking at technology like containers, clouds, network appliances, Software as a Service (SaaS), Platform as a Service (PaaS), and Kubernetes. And managing external resources with various providers can add yet another layer of complexity to the mix.

Terraform, by Hashicorp, is a declarative coding tool that makes it possible for developers to use a high-level configuration language, called HCL (HashCorp Configuration Language) to describe an end-state for your cloud or on-premise infrastructure to reach, for an application to run successfully. 

This Infrastructure as Code (IaC) allows your developers to codify infrastructure and automate provisioning. By doing so, you can experience growth that’s faster, more reliable, and more repeatable (by preventing configuration drift).

Not only that, but by employing IaC, your developers can undertake more experimentation, testing, and optimization for your company’s apps and clouds.

So what makes Terraform the right choice for this task? Considering you have other options, such as Puppet, Chef, SaltStack, and Ansible, let’s take a look at why your business should consider this particular tool.

  • 1_soak_BDev_SRP_Numeros
    Create promotions
  • 1_soak_BDev_SRP_Numeros
    Manage an entire catalog of products
  • 1_soak_BDev_SRP_Numeros
    Optimize your online store for search engines (SEO)
  • 1_soak_BDev_SRP_Numeros
    Make it easy for customers to easily browse and search for your products
  • 1_soak_BDev_SRP_Numeros
    Use easy one-page checkouts and shopping carts
  • 1_soak_BDev_SRP_Numeros
    Save user credit card information
  • 1_soak_BDev_SRP_Numeros
    Manage orders
  • 1_soak_BDev_SRP_Numeros
    Offer customer account dashboards
  • 1_soak_BDev_SRP_Numeros
    Offer plenty of customer service options
  • 1_soak_BDev_SRP_Numeros
    Support mobile HTML5
  • 1_soak_BDev_SRP_Numeros
    Support mobile apps for Android and iOS
  • 1_soak_BDev_SRP_Numeros
    Integrate a wide range of checkout capabilities

Magento also includes:

  • 1_soak_BDev_SRP_Numeros
    Targeted promotions
  • 1_soak_BDev_SRP_Numeros
    Dynamic rule-based product relations
  • 1_soak_BDev_SRP_Numeros
    Persistent shopping
  • 1_soak_BDev_SRP_Numeros
    Automated email marketing reminders
  • 1_soak_BDev_SRP_Numeros
    Private sales
  • 1_soak_BDev_SRP_Numeros
    Gift registries
  • 1_soak_BDev_SRP_Numeros
    Gifting Options
  • 1_soak_BDev_SRP_Numeros
    Rewards points
  • 1_soak_BDev_SRP_Numeros
    Store credits
  • 1_soak_BDev_SRP_Numeros
    Multiple wish lists
  • 1_soak_BDev_SRP_Numeros
    Add to cart via SKU
  • 1_soak_BDev_SRP_Numeros
    Return Management Authorization (RMA)

For any business concerned about scaling, Magento has you covered. Magento 2.0 can:

  • 1_soak_BDev_SRP_Numeros
    Process large numbers of orders per hour
  • 1_soak_BDev_SRP_Numeros
    Handle near-instant server response times for catalog browsing
  • 1_soak_BDev_SRP_Numeros
    Significantly reduce response times for cart and checkout pages
  • 1_soak_BDev_SRP_Numeros
    Handle peak order volume, even with very large product catalogs, and customer lists
  • 1_soak_BDev_SRP_Numeros
    Have simultaneous administrators on the backend

If you’re looking for one of the most powerful eCommerce platforms available, Magento is what you need.

Provisioning over configuration management

Tools like Puppet and Chef are known as configuration management tools. That means you can configure all of your data center (or cloud-based) servers and then deploy those configurations to the target servers from a single source. These types of tools are an amazing addition to any company that uses numerous servers and prefers to manage its configurations from a single controller.

Terraform, on the other hand, is a provisioning tool, which means they are designed to provision servers. That begs the question: what is provisioning?

Provisioning is the process of deploying IT infrastructure. In other words, you prepare a server for use by installing the operating system and any software required to serve your company. To provision servers manually can be very time-consuming. And when you’re tasked with provisioning a large number of servers, doing it manually can lead to many mistakes. 

When provisioning with a tool like Terraform, you automate the process and achieve a level of scale and speed that you couldn’t by undertaking the task manually. With Terraform, you can provision servers, load balancers, databases, and network appliances. You can then use tools like Ansible and SaltStack to automate the configuration of those servers and services.

So it’s not a matter of one or the other, as they serve different jobs. For example, you could provision a cluster of servers with Terraform, configure them with SaltStack, and then orchestrate the deployment of containers with Kubernetes. 

But at the foundation of that deployment chain is a tool like Terraform.

What is the Terraform process?

Terraform has a very specific workflow to take into consideration. The delivery of IaC looks like this:

Use declarative configuration files to create your Infrastructure as Code, making sure to use concise descriptions of all resources, such as:

resource “aws_instance” “example” {

  ami = “ami-408c7f28”

  instance_type = “t1.micro”

  monitoring = true

  vpc_security_group_ids = [

      “sg-1436abcf”,

  ]

  tags = {

    Name = “Application Server”

    Environment = “production”

  }

   root_block_device {

    delete_on_termination = false

  }

}

You can also define providers, such as:

provider “aws” {

 region = “eu-west-1”

 version = “~> 1.19”

 access_key = “${var.aws_access_key}”

 secret_key = “${var.aws_secret_key}”

}

Once you’ve completed writing the HCL file, you must then check to see if the execution plan for the configuration matches what you expect for the provisioning. The plan command is run in the directory containing the HCL file, like so:

terraform plan

If all checks out, you then apply the HCL with the command:

terraform apply

The application of the HCL will then apply the changes to all of your resources, such that they reach the desired state.

And because Terraform is open-source and widely used, there are a large number of supported providers, such as:

  • 1_soak_BDev_SRP_Numeros
    AWS
  • 1_soak_BDev_SRP_Numeros
    Azure
  • 1_soak_BDev_SRP_Numeros
    Google Cloud Platform
  • 1_soak_BDev_SRP_Numeros
    Kubernetes
  • 1_soak_BDev_SRP_Numeros
    Oracle Cloud Infrastructure
  • 1_soak_BDev_SRP_Numeros
    Alibaba Cloud
  • 1_soak_BDev_SRP_Numeros
    Active Directory
  • 1_soak_BDev_SRP_Numeros
    Archive
  • 1_soak_BDev_SRP_Numeros
    Boundary
  • 1_soak_BDev_SRP_Numeros
    CISCO ASA
  • 1_soak_BDev_SRP_Numeros
    Helm
  • 1_soak_BDev_SRP_Numeros
    VMware vSphere

Once you’ve applied your states, you can also make use of Terraform’s Change Automation. With this feature, you can create very complex changesets that can be applied to your provisioned servers, with very little human interaction.

Terraform Use Cases

Let’s take a look at some popular use cases for Terraform.

  • 1_soak_BDev_SRP_Numeros
    Register external services - Terraform can register external services by using the Consul provider.
  • 1_soak_BDev_SRP_Numeros
    Codify Management of Vault - Vault is a service that stores and controls access to code secrets, such as tokens, passwords, and certificates. With Terraform you can automate the usage of Vault to reduce human error.
  • 1_soak_BDev_SRP_Numeros
    Manage Kubernetes Resources - Terraform allows you to schedule Pod instances and expose them to network resources, using the Terraform Kubernetes Provider.
  • 1_soak_BDev_SRP_Numeros
    Multi-Tier Applications - Terraform is an outstanding tool for building and managing N-tier architecture, with each tier described as a collection of resources.
  • 1_soak_BDev_SRP_Numeros
    Self-Service Infrastructure - Terraform makes it possible to easily provision for teams in a "self-serve" manner, such that each team can then manage their own infrastructure with tooling provided by the provisioner.
  • 1_soak_BDev_SRP_Numeros
    Disposable environments - With Terraform you can write HCL files for temporary environments that can be used briefly and then discarded. These environments can be used for testing purposes or Q&A.

Conclusion

Terraform is a remarkable platform that can help the provisioning of your infrastructure be more reliable, faster, and repeatable. Although there is a considerable learning curve with this tool, once you have the developers who know how to employ it, your company will grow faster and farther than you thought possible.

Related Pages

blank

How to Hire a DevOps Engineer

Like grease to machinery, a DevOps engineer that’s the right fit for a project can optimize the development and deployment process.

Clients' Experiences

Ready to work with the Top 1% IT Talent of the market and access a world-class Software Development Team?

Scroll to Top

Get in Touch

Jump-start your Business with the
Top 1% of IT Talent.

Need us to sign a non-disclosure agreement first? Please email us at [email protected].

ACCELERATE YOUR DIGITAL TRANSFORMATION

By continuing to use this site, you agree to our cookie policy.