Packer vs Terraform: What are the differences?
Developers describe Packer as "Create identical machine images for multiple platforms from a single source configuration". Packer automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use automated scripts to install and configure the software within your Packer-made images. On the other hand, Terraform is detailed as "Describe your complete infrastructure as code and build resources across providers". With Terraform, you describe your complete infrastructure as code, even as it spans multiple service providers. Your servers may come from AWS, your DNS may come from CloudFlare, and your database may come from Heroku. Terraform will build all these resources across all these providers in parallel.
Packer and Terraform belong to "Infrastructure Build Tools" category of the tech stack.
Some of the features offered by Packer are:
- Super fast infrastructure deployment. Packer images allow you to launch completely provisioned and configured machines in seconds, rather than several minutes or hours.
- Multi-provider portability. Because Packer creates identical images for multiple platforms, you can run production in AWS, staging/QA in a private cloud like OpenStack, and development in desktop virtualization solutions such as VMware or VirtualBox.
- Improved stability. Packer installs and configures all the software for a machine at the time the image is built. If there are bugs in these scripts, they'll be caught early, rather than several minutes after a machine is launched.
On the other hand, Terraform provides the following key features:
- Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.
- Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.
- Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.
"Cross platform builds" is the primary reason why developers consider Packer over the competitors, whereas "Infrastructure as code" was stated as the key factor in picking Terraform.
Packer and Terraform are both open source tools. It seems that Terraform with 17.4K GitHub stars and 4.77K forks on GitHub has more adoption than Packer with 9.03K GitHub stars and 2.46K GitHub forks.
Instacart, Slack, and Twitch are some of the popular companies that use Terraform, whereas Packer is used by Instacart, SendGrid, and Oscar Health. Terraform has a broader approval, being mentioned in 489 company stacks & 298 developers stacks; compared to Packer, which is listed in 113 company stacks and 20 developer stacks.
Ok, so first - AWS Copilot is CloudFormation under the hood, but the way it works results in you not thinking about CFN anymore. AWS found the right balance with Copilot - it's insanely simple to setup production-ready multi-account environment with many services inside, with CI/CD out of the box etc etc. It's pretty new, but even now it was enough to launch Transcripto, which uses may be a dozen of different AWS services, all bound together by Copilot.
Because Pulumi uses real programming languages, you can actually write abstractions for your infrastructure code, which is incredibly empowering. You still 'describe' your desired state, but by having a programming language at your fingers, you can factor out patterns, and package it up for easier consumption.
We use Terraform to manage AWS cloud environment for the project. It is pretty complex, largely static, security-focused, and constantly evolving.
Terraform provides descriptive (declarative) way of defining the target configuration, where it can work out the dependencies between configuration elements and apply differences without re-provisioning the entire cloud stack.Advantages
Terraform is vendor-neutral in a way that it is using a common configuration language (HCL) with plugins (providers) for multiple cloud and service providers.
Terraform keeps track of the previous state of the deployment and applies incremental changes, resulting in faster deployment times.
Terraform allows us to share reusable modules between projects. We have built an impressive library of modules internally, which makes it very easy to assemble a new project from pre-fabricated building blocks.Disadvantages
Software is imperfect, and Terraform is no exception. Occasionally we hit annoying bugs that we have to work around. The interaction with any underlying APIs is encapsulated inside 3rd party Terraform providers, and any bug fixes or new features require a provider release. Some providers have very poor coverage of the underlying APIs.
Terraform is not great for managing highly dynamic parts of cloud environments. That part is better delegated to other tools or scripts.
Terraform state may go out of sync with the target environment or with the source configuration, which often results in painful reconciliation.
Sign up to add or upvote prosMake informed product decisions
Sign up to add or upvote consMake informed product decisions
What is Packer?
What is Terraform?
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions