Controlling your cloud services with Terraform
Terraform is a popular tool for managing your infrastructure – but it’s much more than just a configuration management tool. It’s more of a configuration orchestration system that provides an additional layer of functionality compared to other configuration management tools such as Ansible, Puppet and SaltStack.
Unlike them, Terraform concentrates more on server provisioning. It uses infrastructure as code (IAC) and works with any cloud – whether private on-premises or public. That of course includes IaaS providers such as AWS, Azure, Google Cloud, Oracle Cloud, OpenStack and Alibaba Cloud.
Because Terraform treats infrastructure as code, APIs can be codified into declarative configuration files that can be shared and worked on by team members, as with any other code. That lets you collaborate and share configurations, evolve and version your infrastructure, and automate provisioning. It also lets you leverage the cloud provider’s API for provisioning, which removes the need for additional security checks and running separate configuration management servers.
Another difference is that Terraform utilises immutable infrastructure whereas Ansible, Puppet and SaltStack default to mutable infrastructure. With the latter, software updates must be run in place – which can result in configuration drift. That’s where each server over time becomes slightly different from the others, which can lead to bugs and security risks. With Terraform, every new update is actually the deployment of a new server, with de-provisioning of the old one.
As well as the benefits discussed above (server orchestration and not just configuration, declarative and not procedural code, client-only architecture and immutable infrastructure), Terraform allows super portability. It gives you one tool for managing infrastructure for AWS, Google Cloud, Azure and any other cloud.
A Strong Community
Terraform is an open source IAC tool that was released in 2014. As such, it’s a bit younger than Ansible (2012) and SaltStack (2011), and a lot younger than Puppet (2006). As of May 2019, Terraform was version 0.12.0 as opposed to Ansible’s 2.5.5 and Puppet’s 6.0.9.
But what it lacks in maturity, it makes up for with its huge community. It currently has around 25,000 commits, over 1,000 verified and community modules, and over 200 providers. An analysis of IAC communities in May 2019 shows that Terraform is undergoing massive growth – with phenomenal increases in the number of contributors and stars in GitHub, open source libraries, StackOverflow posts, and number of jobs that mention the tool on indeed.com. (Ansible is also growing very strongly.)
The future certainly looks strong for Terraform, and it will likely become even better and more popular over time. It’s a very valuable tool for your DevOps toolkit.
Here at JBI Training, we provide a range of exceptional DevOps and Cloud training courses including:
- Terraform training course (2 days) where you learn how to use Terraform to control your cloud services – See our Terraform training course outline
- DevOps Introduction training course (5 days) where you gain comprehensive DevOps skills with AWS, Docker, Ansible and Terraform – See our DevOps Introduction training course outline
- Ansible training course (2 day) where you learn to use Ansible to build, ship and run distributed applications on an open platform – See our Ansible training course outline