Terraform Software



  1. Terraform Software Download
  2. Terraform Software Tutorial
  3. What Is Terraform Software
Terraform
Original author(s)Mitchell Hashimoto et al.
Developer(s)HashiCorp
Initial releaseJuly 28, 2014; 6 years ago
Stable release
Repository
Written inGo
Operating systemLinux, FreeBSD, macOS, OpenBSD, Solaris, and Microsoft Windows
Available inEnglish
TypeInfrastructure as code
LicenseMozilla Public License v2.0[2]
Websitewww.terraform.io

Terraform is an open-sourceinfrastructure as code software tool created by HashiCorp. Users define and provision data center infrastructure using a declarative configuration language known as HashiCorp Configuration Language (HCL), or optionally JSON.[3]

Terraform configuration for a compute instance can use a Packer image to provision your instance without manual configuration. In this tutorial, you will create a Packer image with a user group, a new user with authorized SSH keys, and a Go web app. Then, you will deploy this image using Terraform. Terraform Cloud (TFC) is a free to use, self-service SaaS platform that extends the capabilities of the open source Terraform CLI. It adds automation and collaboration features, and performs Terraform functionality remotely, making it ideal for collaborative and production environments. Terraform operates by calling into the APIs of various service providers and systems. Thus in principle Terraform can manage anything that has an API, and in practice it has existing support for a few different on-premises-capable systems, including. OpenStack; VMWare vSphere; CloudStack; If the compute resources in your existing datacenter infrastructure are already managed with one of these. For an in-depth tutorial of using CDK for Terraform, read the HashiCorp blog post. HashiCorp Terraform as a Platform for CDK Applications. HashiCorp Terraform follows an Infrastructure as Code approach and is extensible to support many providers of cloud infrastructure and software services.

Design[edit]

Terraform manages external resources (such as public cloud infrastructure, private cloud infrastructure, network appliances, software as a service, and platform as a service) with 'providers'. HashiCorp maintains an extensive list of official providers, and can also integrate with community-developed providers.[4] Users can interact with Terraform providers by declaring resources[5] or by calling data sources.[6] Rather than using imperative commands to provision resources, Terraform uses declarative configuration to describe the desired final state. Once a user invokes Terraform on a given resource, Terraform will perform CRUD actions on the user's behalf to accomplish the desired state.[7] The infrastructure as code can be written as modules, promoting reusability and maintainability.[8]

Hashicorp Terraform Review. HashiCorp's Terraform is the software to use if you are looking to be able to construct or reconstruct entire infrastructure of an organization/project in a very short period of time and maintain the changes as code.

Terraform supports a number of cloud infrastructure providers such as Amazon Web Services, Microsoft Azure, IBM Cloud, Google Cloud Platform,[9]DigitalOcean,[10]Oracle Cloud Infrastructure, VMware vSphere, and OpenStack.[11][12][13][14][15]

HashiCorp also supports a Terraform Module Registry, launched in 2017.[16] In 2019, Terraform introduced the paid version called Terraform Enterprise for larger organizations.[17]

Terraform has four major commands:

See also[edit]

References[edit]

  1. ^'Releases - hashicorp/terraform'. Retrieved 22 January 2021 – via GitHub.
  2. ^Terraform's LICENSE
  3. ^'Syntax - Configuration Language'.
  4. ^'Providers'.
  5. ^'Resources'.
  6. ^'Data Sources'.
  7. ^'Configuration'.
  8. ^'Modules'.
  9. ^'Google Cloud Platform Provider for Terraform'. Retrieved 2017-02-05.
  10. ^Starr-Bochicchio, Andrew (2018-10-22). 'Introducing the DigitalOcean Terraform Provider'. DigitalOcean Blog. Retrieved 2020-12-17.
  11. ^'Terraform vs. Chef, Puppet, etc. - Terraform by HashiCorp'. Terraform by HashiCorp. Retrieved 2018-03-14.
  12. ^Bryant, Daniel (2017-03-26). 'HashiCorp Terraform 0.9. Released with State Locking, State Environments, and Destroy Provisioners'. InfoQ. Retrieved 2017-05-23.
  13. ^Yevgeniy., Brikman (2017). Terraform Writing Infrastructure as Code. O'Reilly Media. ISBN9781491977057. OCLC978667796.
  14. ^Somwanshi, Sneha (2015-03-01). 'Choosing the Right Tool to Provision AWS Infrastructure'. ThoughtWorks Blog.
  15. ^Turnbull, James (2016). The Terraform Book. ISBN9780988820258.
  16. ^Atkins, Martin (2017-11-16). 'HashiCorp Terraform 0.11'. HashiCorp Blog. Retrieved 2020-12-17.
  17. ^HashiCorp. 'HashiCorp Terraform - Provision & Manage any Infrastructure'. HashiCorp: Infrastructure enables innovation. Retrieved 2020-04-15.

External links[edit]

  • Official website
  • terraform on GitHub
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Terraform_(software)&oldid=1001993530'

The way DevOps as a culture is gaining momentum, tools like Ansible and Terraform witnessing a huge demand and popularity.

Both tools are considered as Infrastructure as Code (IaC) solutions which helps in deploying code and infrastructure. While Ansible acts as a configuration management solution commonly abbreviated as “CM”, Terraform is a service orchestration or provisioning tool.

Note that there are overlaps and these terms are not necessarily mutually exclusive. This is what confuses people and this is why I am going to compare Ansible and Terraform.

I'll explain what are these tools used for, what are their pros and cons. This will help you decide whether you should use Ansible or Terraform in your projects.

Ansible and Terraform: What are these tools?

Let's first briefly take a look at what are these popular DevOps tools.

What is Ansible?

Ansible is an IT automation tool. It can configure systems, deploy software, and perform more advanced IT tasks such as continuous deployments or zero downtime rolling updates.

What is Terraform?

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

Before highlighting the differences between these two tools let us first understand what Configuration Management and Orchestration is.

Configuration Management vs. Orchestration

Configuration management is a set processes and procedures that ensures that the desired and consistent state of your infrastructure which includes servers and software's are always met. In other words, it's a way to make sure that a system performs as it's expected to as changes are made over time.

CM tools ensure that IT deployments are faster, incremental, repeatable, scalable, predictable, and maintains the desired state, which brings managed assets into an expected state.

Tools like Ansible are used for doing configuration management.

When it comes to orchestration you can use the orchestration tools to not only provision servers, but also databases, caches, load balancers, queues, monitoring, subnet configuration, firewall settings, routing rules, SSL certificates, and almost every other aspect of your infrastructure, mainly public cloud infrastructure.

Terraform is an orchestration tool. It is designed to provision the server instances themselves, leaving the job of configuring those servers to other tools.

Procedural vs. Declarative Language

Terraform Software Download

DevOps tools can be categorized as Procedural or Declarative based on how they perform their actions when applied.

Procedural describes an application that requires the exact steps to be laid out in the code whereas Declarative “declares” exactly what is needed, not the process by which the result is achieved.

Ansible uses procedural style where you write the code that specifies, step-by-step tasks in order to achieve desired end state.

Whereas tools like Terraform, AWS CloudFormation all are declarative in defining the process where you write code that specifies your desired end state. For example, if you needed 5 EC2 instances, that’s exactly how many you would have after the code has been executed.

Ansible and Terraform: Comparison

Let's see what are the advantages and disadvantages of using Terraform:

Pros of Terraform

  • Terraform maintains whole cloud infrastructure and make those resources available as code. That makes incremental change process very easy.
  • Modular design.
  • Simple and Easy-to-Learn
  • It maintains the state of the resources created. All the objects created by Terraform shall be recreated if deleted by any other process.
  • Seamless integration with CI/CD pipelines.
  • It allows import of existing resources to bring them in Terraform state.
  • When you run terraform plan, it shows the changes that are about to be applied to resources that already exist. This gives DevOps engineers an insight into the changes they're about to make, particularly if the changes are not as expected.

Cons of Terraform

  • No rollbacks. You need to destroy everything and re-run of the tf script is required.
  • Error handling is not mature. As of Terraform v.12.20 there are two new functions available for consumers try() and can().
  • Terraform scripts creation isn't allowed directly from state files.
  • Terraform tool is still under development and going through many beta releases each month.
  • Not every item can be imported. terrafom import command can only import one resource at a time. This means you can't yet point Terraform import to an entire collection of resources such as an AWS VPC and import all of it.

Pros and cons of using Ansible

Now, let's take a look at the positives and negatives of Ansible.

Pros of Ansible

  • Simple and Easy-to-Learn
  • Agentless
  • Make the whole deployment process automated and developer friendly
  • YAML based simple and readable scripts (Ansible Playbooks)
  • Huge module support
  • Availability of a central repository called Ansible galaxy to find and reuse Ansible content.

Cons of Ansible

  • Lacks in UI offering. AWX which eventually evolved into Ansible tower still has a huge room for improvement.
  • No state maintenance. Ansible doesn’t keep track of dependencies. It just executes a sequential series of tasks, stops when it finishes, fails or encounters an error.
  • Not up to the mark when it comes to Windows OS support. Ansible is still in early stages to extend support for Windows.
  • Not that straightforward if you have to write complex scripts with extensive logics in playbooks.
  • Enterprise support isn't yet matured/reliable.
  • Lacks descriptive error messages when it comes to debugging complex playbooks.

Terraform or Ansible? Which one is better for you?

Believe me, it's not a simple question to answer. Because it depends largely on your requirements.

In real world, within IT organizations, you never rely on one tool instead you use combination of different tools to achieve the desired results.

Both Ansible and Terraform tools do a lot of things pretty well. And my personal preference is to use Terraform for orchestration/provisioning and Ansible for configuration management.

Terraform Software Tutorial

Terraform performs at its best of capabilities when used for infrastructure orchestration (managing cloud resources) as this is what it was created for.

Ansible, on the other hand, is best suited and optimized for configuration management tasks (provisioning software and machines). Orchestration tasks also can be performed with it, but that is just part of what it does.

My suggestion - use what is best and originally created for the task you want to perform.

But that's not the rule of thumb either as you may find people who prefer to use one tool for everything and it works for them!

Conclusion

Tutorialspoint

Both tools have their own benefits as well as limitations when designing Infrastructure as Code environments for automation. And yes, the success totally depends on knowing which tools to use for which jobs.

I hope I have made a few things around Ansible and Terraform clearer for you. If you still have questions or suggestion, please let me in the comment section.

Become a Member for FREE
Become a member to get the regular Linux newsletter (2-4 times a month) and access member-only content

What Is Terraform Software

Join the conversation.





Comments are closed.