It’s a common problem. You can’t seem to develop and deploy applications fast enough to meet your customers’ changing demands. By automating the processes involved, however, you can speed things up.
You’re also able to scale up and down on the fly, reduce manual errors, improve the overall availability of the application and realize the cost benefits of on-demand compute. Sounds great, right? But as Tom Hanks’ character said in the movie, A League of Their Own, “If it was easy, everyone would do it.”
Part of the difficulty in automating app development and deployment is determining the tools to use. While your choices will be driven in large part by your use case, here’s a brief overview of some tools that fall under the heading of Infrastructure-as-Code (IaC) and how we used them at ClearScale for one of our customers.
How IaC Works
The costs and potential for error in app development and deployment often lie in getting the infrastructure ready. That’s because setting up new infrastructure requires stacking physical servers, configuring network cables, and housing hardware in a data center. At least, it used to; now we can do it all with IaC.
With IaC, we can use software to automatically manage and provision the technology stack for an application instead of manually configuring discrete hardware devices and operating systems. IaC functions much the same way as programming scripts used to automate IT processes.
The difference is that scripts are primarily used to automate a series of static steps that are repeated across multiple servers. IaC employs descriptive language to code versatile, adaptive provisioning and deployment processes.
A Sample of IaC Tools
There are a variety of IaC tools available. Some employ a standard template format, such as YAML and JSON. Others use a domain-specific language (DSL).
Some are specifically for configuration orchestration. They’re designed to provision the servers, leaving the configuration to other tools. Others handle configuration management and are used to install and manage software on existing servers.
Most configuration management tools can do some level of provisioning, while most orchestration tools can do some configuration management. Depending on the need, some of the tools are going to be a better fit for certain types of tasks.
The following are some of the most popular IaC tools.
• CloudFormation is AWS’ IaC tool and is strictly for AWS cloud services. It’s considered a configuration orchestration tool. Written in JSON, it includes numerous templates to help you get started.
• HashiCorp Terraform is an open-source, cloud-agnostic tool designed for configuration orchestration. It’s written as a JSON-like declarative configuration file that can be version controlled, tested, and executed repeatedly to stand up the infrastructure on multiple deployment tiers. Or, it can rebuild the infrastructure from scratch when needed. Like CloudFormation, it includes pre-written modules.
• Chef uses Ruby-based DSL and is considered a configuration management tool. It allows you to create “recipes” and “cookbooks,” which specify the steps for configuring your applications and utilities on existing servers. Chef works with many different cloud service providers.
• Puppet also uses Ruby-based DSL, is a configuration management tool and works with leading cloud services. You can define the desired end state of your infrastructure and exactly what you want it to do. Then Puppet automatically enforces that desired state and fixes any incorrect changes.
• RedHat Ansible is an agentless tool that operates over SSH or WinRM. The IaC code is written in YAML. Ansible has modules for building infrastructure in various clouds as well as on premise.
There are many others as well. And like those listed above, each has its share of advantages and disadvantages.
Real World IaC Use
It’s one thing to talk about IaC. It’s another to put it in action. Here’s an example of how used it with one of our clients.
When we were approached by a client with the need for architecting, automating and deploying multiple environments on AWS for app development, testing, staging and production, choosing the right IaC tools was among the many decisions that needed to be made.
Drawing on our understanding of the client’s needs, industry best practices and our expertise in these kinds of projects, we decided the infrastructure would be best designed using Docker container software in the form of AWS managed Elastic Container Service (Amazon ECS).
With Docker, an operating-system-level virtualization software for containers, you can create images, such as containers or virtual machine images, that have all the software your server needs already installed and configured. By placing our customer’s primary workloads in managed Docker containers and running them on Amazon ECS, the customer wouldn’t have to install and run its own container orchestration software.
Docker also enables code deployment with standardized continuous integration and delivery (CI/CD) pipelines. Ansible was selected for automating, installing, and configuring an AWS server instance with Jenkins, an open-source tool for implementing continuous integration/delivery (CI/CD). Adding the Jenkins pipeline would help us make the build definitions part of the source code and be version controlled.
For building our AWS IaC, it came down to either AWS CloudFormation or Terraform. We chose Terraform, in part, because it accommodates multi-cloud deployment in a single script and allows for tighter integration with a broad range of services.
Get in touch today to speak with a Cloud expert and discuss how we can help: