Live data from Hacker News

Speeding up Azure development by not using Terraform

nitric.io

11–20 of 87 posts

Re: Speeding up Azure development by not using Terraform

#11
I'm always hesistant about articles about how a product is good written by the company making the product.

However, when it comes to solutions to problems "Separation of Concerns" is the best solution. I don't want my application code telling azure what resources to make. I want to tell azure what resources to make, and I want to be 100% sure that what is created is what I want because we're talking about something that costs my company money to run it.

While Terraform is a lot of code to get something defined and started (and I do think there's room for improvement), the degree of what you can define with it and how much you control are the key selling points.

Re: Speeding up Azure development by not using Terraform

#12
post #9
post #4

Sure, by using their solution instead. The only real alternative is to use PowerShell or AZ CLI instead.

Well, sorta. Azure has Bicep now [1], to compete with Terraform and ARM JSON templates. (Separately, there's also the whole Dapr thing, what a sight to see that Discord and complete lack of interest from anyone outside the company). [1]: https://learn.microsoft.com/en-us/azure/azure-resource-manag...

Bicep is fantastic. But it compiles to ARM, so it's still limited by ARM's weaknesses and gaps, in addition to the underlying general instability of Azure and the inconsistencies from the Resource Providers. As well, Bicep is declarative- which is elegant in theory, but the stateful design of Terraform can cover up some of those underlying ARM/Azure gaps in practice. The deployment stacks approach on Azure should help further, but there's still a long way to go.

Re: Speeding up Azure development by not using Terraform

#13
This is a biased representation of what Nitric can do for you.

The Terraform you've written out looks like a lot, but the Nitric code is doing a huge amount of lifting in this example.

Not to mention that Nitric is wrapping a Pulumi provider (granted they are using `pulumi-azure-native` unlike the `pulumi-azure` provider that's just a Terraform wrapper).

You can do this exact kind of Function Serialization in Pulumi anyway: https://www.pulumi.com/docs/concepts/function-serialization/....

At the end of the day this article is abstracting a huge amount and whilst for startups it might be fine? When something goes wrong you'll want to be able to debug the random queue backlog in your stack.

For an example of this done beautifully in one language where they're managed close the loop with monitoring, I would checkout Encore: https://encore.dev/.

Re: Speeding up Azure development by not using Terraform

#14
Others' concerns are valid; the separation of concerns makes infra changes safer and easier to understand. Infra-tooling is slow because of the inherent risk of managing stateful services.

Mixing the infra and application logic is the obvious path forward, though. Just as most applications don't need more than Rails and a single Postgres, most apps don't need customized infra. Simplifying the 80% unlocks cycles for more creative work. Suppose you are successful enough to have to define custom infra at some point. That's good for you. That's a great problem to have.

AI is going to standardize architectures going forward. Providing a simple set of tools in the same code as the logic makes the planner easier for Copilots and reduces the context windows. Terraform and application code have implicit dependencies. Colocating them lets you define explicit dependencies that are more understandable.

Re: Speeding up Azure development by not using Terraform

#15
post #3

Earlier quoted context omitted.

Certainly, but Terraform also sucks at this! I have had all sorts of problems with providers that basically lie to your face about the guarantees they make, state files always getting funky and needing escalation, special things needing to be put in special files or "terraform will get mad" (the actual staff sre's comments) It's not a tool I have ever thought was great!

That's fine but that's not really a fault of terraform usually but the provider. Terraform itself is a wrapper around the cloud API's the providers use. For your comments regarding "state files getting funky" I have also never seen this as a problem with terraform itself, but rather people doing insanely stupid things with it. "terraform gets mad" seems like a constraint of whatever home-grown modules your staff SRE…

Often, I've experienced state file issues as a result of some not-so-nice dependencies between AWS services. For example, Terraform deletes one thing and then turns around and tries to delete another thing, which fails because the first thing was deleted (it's been a while, so I don't have a detailed example, unfortunately). The result is the state file can no longer be reconciled without manual intervention.

As you pointed out, though, it's not an issue with Terraform, and the above case can be solved by manually managing the dependency with lifecycle management. So, I agree that most cases are often inflicted by things outside of Terraform.

Re: Speeding up Azure development by not using Terraform

#16
post #3

It's all fun and games until you want to do something even semi non-standard. Nitric even calls this out: > If you wanted to be able to completely customise your infrastructure, using IaC can be practical. However, it is rare that an application requires any level of customisation beyond the default. I'm assuming this project is targeting rapid prototype/"entrepreneur" market because I can assure you that basically e…

Certainly, but Terraform also sucks at this! I have had all sorts of problems with providers that basically lie to your face about the guarantees they make, state files always getting funky and needing escalation, special things needing to be put in special files or "terraform will get mad" (the actual staff sre's comments) It's not a tool I have ever thought was great!

This tool is going to have the same problems as Terraform only worse.

It's wrapping Pulumi and managing the state file for that. Yet another abstraction layer on-top of it all.

I'd love to be proven wrong if they can output Pulumi code from their application code?

Even then, I'm not sure what the monetization play here is? You're standing on the shoulders of Pulumi and you're open-source. If you go down the managed route and host the state files you'll be in direct competition with Pulumi's cloud offering...

Re: Speeding up Azure development by not using Terraform

#17
post #9
post #4

Sure, by using their solution instead. The only real alternative is to use PowerShell or AZ CLI instead.

Well, sorta. Azure has Bicep now [1], to compete with Terraform and ARM JSON templates. (Separately, there's also the whole Dapr thing, what a sight to see that Discord and complete lack of interest from anyone outside the company). [1]: https://learn.microsoft.com/en-us/azure/azure-resource-manag...

Sure as the sibling comment replies, depends how much love you have to debug the ARM code it generates.

Dapr has some love on the .NET community, and apparently is used by Aspire, however I have seen little adoption of it on polyglot projects.

When not using terraform, I find the scripting approaches easier to follow up.

Re: Speeding up Azure development by not using Terraform

#18
post #4

Sure, by using their solution instead. The only real alternative is to use PowerShell or AZ CLI instead.

Terraform feels like a useless wrapper on top of AZ CLI and resource definition yaml files. In general, Terraform provides nothing but a useless wrapper that people need to understand.

Furthermore, most companies don't need K8S either if they are using a cloud provider. It only starts being cheaper if you forget what you pay the DevOps team (or senior devs who do DevOps on top of code) AND have a huge number of resources. Otherwise you literally have to be in maybe the top 30 companies for K8S to actually save you money.

Re: Speeding up Azure development by not using Terraform

#19
I've never used Nitric, but tools of this nature tend to run up against the realities of irreducible inherent complexity.

You fundamentally cannot build abstractions that are both easier *and* as flexible as the thing you are abstracting away, and so tools like this, as other commenters have noted, are great for a simple happy path, but that's almost never what you need once you're outside the tutorial and building something "real", which requires the very flexibility that has been abstracted away.

This is very similar to the argument against (most) ORMs and similar tools. For simple, happy path cases, you can avoid knowing SQL (or in Nitric's case, infrastructure management, platform-specific resources) and use whatever DSL/framework you have, but if you want to do something more complicated, you either have to hack and kludge your way through with the system, or drop down to the lower level and forego the abstraction entirely.

As an aside: Azure is a pain to use with Terraform as its API endpoints seem to be an order of magnitude slower than the equivalent GCP or AWS APIs, so things like `terraform plan` can throw you out of flow even on modestly sized projects. Going back and forth between Azure and other clouds is night and day.

Post reply on HN