An excellent article by one of the employees at Gruntwork.io is an excellent read about Terraform. The article is about why they use Terraform. The article logically discusses choosing between Chef, Puppet, Ansible, SaltStack, Cloudformation, and Terraform.
Advantages

Compliance, Control, Standardization
“Infrastructure as Code” (IAC) enables compliance without surrendering security by utilizing configuration management techniques, fine-grained controls, and automated compliance policies. Believe it or not, IAC also enables developers, administrators, or engineers more freedom during the development or testing of new systems. “Infrastructure as Code” enables code that builds the infrastructure in a standard and automated method such that developers do not have to build their development or test environments manually. Instead, they launch a script that creates an environment automatically and expediently.
A manual installation process has the potential for errors and minor alterations that lead to different builds. Different installations within alternate environments will eventually lead to the phrase “Well, it worked on my machine” after it fails on another machine. Gruntwork accurately depicts this as “configuration drift.” Infrastructure as Code (IaC) allows repeatable and consistent installations.
Benefits for simple to complex projects
Due to consistency and automation, developers utilize consistent infrastructure throughout a project. They are using a configuration template at all stages from a personal development environment into testing stages and then into full production environments.
Reduction in operating expense
Infrastructure as Code (IaC) can create a complete infrastructure in minutes, in a repeatable, consistent, and agreed configuration. In contrast, manual configuration can take tremendously longer (because it is a manual process). And prone to errors.
Better use of Time (Manpower cost savings)
An automated installation allows all involved to focus on critical, high-value tasks (not taking half the day for setup)
Disposable Environments (CapEx cost savings)
Due to being able to create repeatable infrastructure, the infrastructure doesn’t have to be left running all the time. Infrastructure is easily created only when needed in a time-efficient formulation of infrastructure. Therefore, infrastructure can be disposable. “Infrastructure as Code” enables quick and efficient creation of infrastructure that becomes easy to destroy and easy to recreate exact duplicates of the infrastructure.
Terraform (& Ansible) to the rescue
First, let me state for the record, this process does not belong exclusively to First, let me state for the record, this process does not belong exclusively to software development (not by a long shot). Just having the ability for an IT department to create different environments that are documented, repeatable, standard configuration, and easily migrated from test into development and then into production, in my opinion, has to be attractive to any IT discipline.
“Infrastructure as Code” scripts work with the most popular cloud platforms and on-premise platforms. Note: While Infrastructure as Code works with many platforms, the scripts are not automatically transferable from one platform to another platform. Terraform can manage public clouds like Amazon Web Services, Microsoft Azure, Google Cloud Platform, or on-prem in private clouds such as VMWare vSphere, OpenStack, or CloudStack.
Terraform & Ansible coding empowers conventional businesses, software development businesses, and small startup businesses, all of the above, to deploy standardized, immutable, and repeatable infrastructure into on-prem data centers and cloud environments using Infrastructure as Code. The code itself is put into configuration management, stored in a repository for all engineers to deploy infrastructure configuration through QA tests and release management.
Terraform Examples
Before I get into some examples, let me just point out that I use Ansible for server configuration and Terraform for provisioning. The examples below use Terraform to create an AWS VPC, public & private subnets, security groups, AWS EC2 instances. The examples then call on Ansible playbooks to create a repeatable configuration of software on the EC2 instances.
See page Terraform Examples