Published on 11/8/2024 - by Eddie
Upify initially generated custom YAML config files to handle deployment configurations. But after talking with some early users and reviewing the available tools, I realized that building Upify on top of an existing, widely adopted ecosystem would make it a lot more versatile and extendable. My choice came down to two popular Infrastructure as Code (IaC) options: Pulumi and Terraform.
Pulumi
Pulumi stands out in the IaC landscape because it lets you define infrastructure within your application's codebase. Rather than using a domain-specific language, you write configurations in familiar, general-purpose languages like Python, JavaScript, Go, or TypeScript. This flexibility opens the door to all kinds of possibilities—dynamic infrastructure configurations, logic-driven infrastructure decisions, and more.
To set up something like a database and an S3 bucket on AWS, you might write something as simple as:
This approach lets you do pretty much anything you want—you could even call an API or connect to a database to dynamically define your infrastructure based on real-time data. That’s pretty cool if you need that kind of flexibility.
Pulumi Pros:
- Language Flexibility: Define infrastructure using your language of choice.
- Extensibility: Pulumi’s SDK allows seamless integration of custom logic.
- Community Growth: It’s open-source and has a passionate, growing community behind it.
Terraform
Terraform is the 900-lb gorilla in IaC, widely adopted across industries for its reliability and expansive ecosystem. Terraform defines infrastructure using its own language, HCL (HashiCorp Configuration Language), a straightforward language designed specifically for infrastructure. HCL supports loops and conditional logic but isn’t as flexible as a general-purpose programming language.
For example, configuring an S3 bucket and RDS instance in Terraform might look something like this:
Terraform’s design prioritizes simplicity, which helps keep infrastructure configurations clean and easy to read. This simplicity also reduces the risk of bugs, which can be a huge deal in infrastructure—you don’t want surprises there.
Terraform Pros:
- HCL-Based: Simple but powerful language designed specifically for infrastructure.
- Mature Ecosystem: Extensive support, integrations, and a well-established community.
- Free to Use: Although not fully open-source anymore, Terraform remains free for most use cases.
- Stable and Reliable: Proven across countless environments and widely trusted in production.
Why Upify Chose Terraform
In the end, Terraform was simply the better fit for Upify. For one, Terraform is more mature, with a larger community and ecosystem to tap into. But the biggest reason is Terraform’s use of HCL for defining infrastructure. Since Upify is language-agnostic, HCL allows it to create the same configuration for any language, without needing to adapt or insert code into language-specific wrappers. This consistency keeps Upify simpler and more streamlined for users, no matter what language they’re working in.