Live data from Hacker News

Rethinking Infrastructure as Code from Scratch

nathanpeck.com

31–40 of 124 posts

Re: Rethinking Infrastructure as Code from Scratch

#31

this is great, but I would argue the biggest issue with infrastructure as code is this: the structure and syntax for AWS is entirely different from Azure is entirely different from GCP. Instead of abstracting to CSS, I would argue modeling what Bytecode did in java for multi-operating system, we should do for infrastructure of code. That way, you could easily replicate in different environments, free yourself from ve…

You can do that through abstraction. You “include” your Terraform Azure Provider or Terraform AWS Provider. At the end of the day, your module needs to know what it’s interacting with but not the higher level of abstraction. We have done it at my work to make it cloud agnostic just in case we need to go to another CSP

That's a lot like peppering your C code with #ifdef/#ifndef to write code that's "platform independent." Just like in the bad old days.

Re: Rethinking Infrastructure as Code from Scratch

#32
post #31

Earlier quoted context omitted.

You can do that through abstraction. You “include” your Terraform Azure Provider or Terraform AWS Provider. At the end of the day, your module needs to know what it’s interacting with but not the higher level of abstraction. We have done it at my work to make it cloud agnostic just in case we need to go to another CSP

That's a lot like peppering your C code with #ifdef/#ifndef to write code that's "platform independent." Just like in the bad old days.

No, it’s object oriented like

Re: Rethinking Infrastructure as Code from Scratch

#33

I use Azure. When I need to provision anything I have a powershell script that interacts with Azure CLI. My script sets up a new resource group for every service we create, logging, key vault, webapp/functions, and if needed some kind of data storage or queuing. In my powershell script I can via a variable indicate which environment I want to spin up: dev, staging, prod. I have one yaml file which is for my build and…

Just use pulumi (self-hosted in blob storage). Using a custom script is not the good choice when you could use the right tool for the job.

Re: Rethinking Infrastructure as Code from Scratch

#34
post #19

I use Azure. When I need to provision anything I have a powershell script that interacts with Azure CLI. My script sets up a new resource group for every service we create, logging, key vault, webapp/functions, and if needed some kind of data storage or queuing. In my powershell script I can via a variable indicate which environment I want to spin up: dev, staging, prod. I have one yaml file which is for my build and…

Why not Bicep? https://learn.microsoft.com/en-us/azure/azure-resource-manag... I have found it quite joyful to use with Azure.

Looks to me like a vendor specific language with limited capabilities compared to others. Just use Pulumi TypeScript (self hosted). I'm not affiliated with Pulumi, it's just that unjustified vendor lock-in infuriates me.

Re: Rethinking Infrastructure as Code from Scratch

#35

I don't think the author has tried Pulumi, which can do exactly this kind of thing.

Or cdktf

> This is a bold statement I know. But I do not believe that infrastructure as code can ever get significantly simpler in its current form

Everything can be made easier to use. Pick the subset of functionality you care about and package it up as a library or module for other teams to use. This was how I paid the bills for years.

Re: Rethinking Infrastructure as Code from Scratch

#36
Some of the ideas here remind me of OAM: https://oam.dev/

OAM has a model of components (things like containerized workloads, databases, queues), traits (scaling behavior, ingress) and in the latest draft, policies that apply across the entire application (high availability, security policy).

It's all a little disjointed and seems to have lost steam. KubeVela is powering along, but it's the only implementation, and IMO it's highly opinionated about how you do deploys and works well for Alibaba and perhaps not for others. But it has some interesting ideas.

Re: Rethinking Infrastructure as Code from Scratch

#39

this is great, but I would argue the biggest issue with infrastructure as code is this: the structure and syntax for AWS is entirely different from Azure is entirely different from GCP. Instead of abstracting to CSS, I would argue modeling what Bytecode did in java for multi-operating system, we should do for infrastructure of code. That way, you could easily replicate in different environments, free yourself from ve…

You can do that through abstraction. You “include” your Terraform Azure Provider or Terraform AWS Provider. At the end of the day, your module needs to know what it’s interacting with but not the higher level of abstraction. We have done it at my work to make it cloud agnostic just in case we need to go to another CSP

This hould be done even if you don't care about being agnostic. Lay out your declarations in the format you'd like to interact with, then transform them to whatever they need to be.

Re: Rethinking Infrastructure as Code from Scratch

#40
post #19

I use Azure. When I need to provision anything I have a powershell script that interacts with Azure CLI. My script sets up a new resource group for every service we create, logging, key vault, webapp/functions, and if needed some kind of data storage or queuing. In my powershell script I can via a variable indicate which environment I want to spin up: dev, staging, prod. I have one yaml file which is for my build and…

Why not Bicep? https://learn.microsoft.com/en-us/azure/azure-resource-manag... I have found it quite joyful to use with Azure.

Bicep has limitations which makes it non-declarative even though it is marketed as declarative: https://learn.microsoft.com/en-us/azure/azure-resource-manag...

MSFT is trying to add features to make this better, but it is not in production yet: https://github.com/Azure/bicep/issues/10460

Additionally, Bicep does not support interacting with Azure Active Directory: https://github.com/Azure/bicep/issues/7724

So it really is not very useful. Terraform is better in almost every single conceivable way.

Post reply on HN