As a programmer, I generally like what I do. But occasionally I find myself having to deal with something that just seems to suck all of the joy out of existence and make me long for the comfort of an early grave. One of those things is Amazon Web Services (AWS).
Back in the prehistoric era, many years BC (before Covid), I got my first job as a web developer. This was probably some time in 1997. Our agency operated several webservers which hosted our websites. These were actual real, physical machines (a SPARCstation IPX and an Ultra 10 if you're interested). They were connected to the network, you could connect to them with telnet for administration, and a single machine could host a number of websites. If you wanted to update the software on it, you downloaded the source code from somewhere and compiled it yourself. Happy days.
Now, everything is completely different. Obviously there must be some real hardware somewhere (imagine racks upon racks upon racks of servers in a huge warehouse or maybe something out of The Matrix). However, all of the servers that you might deal with as a developer are virtualized, along with the network, storage, basically everything. And, being virtual, they can all be created and managed entirely by code.
Gone are the days in which you had to crawl around server rooms and run cables between machines and routers, configure IP addresses, and all the rest of it. All of the infrastructure can be configured and reconfigured automatically as desired, and here is where the misery begins. There are basically two ways to manage the infrastructure:
Web UIs are almost all awful and the AWS UI is no exception. It's like you are trying to configure and manage a huge, complicated structure, but you can only peer at it through tiny little windows. You can get lists of things e.g. what machines are currently running, you can click on them to look at more lists, and navigate through an endless maze of lists, sometimes having to backtrack to check a thing in the current list against something you saw in a list a few screens ago, and then retrace your steps back to the thing that was the current list but now isn't because you left it, by which time you've forgotten why you retraced your steps anyway. Finding the piece of information you want in the web UI always reminds me of the definition of "Cannock Chase" in The Meaning of Liff.
No-one with sense would use the web UI to configure infrastructure for a site, because there are automated ways to do it, and typically you want to be able to modify (or even destroy) bits of infrastructure when deploying an updated version of the site.
So you use Terraform and your infrastructure is described by gazillions of configuration files (or maybe one very very big file), describing storage buckets, security groups, servers, network interfaces, autoscaling groups and a hundred other bits and pieces that all need to be wired together. All of these things are tied together by identifiers, which have to be kept in sync between different files (e.g. maybe file 'a' describes a bucket with some identifier, and file 'b' describes a server which needs to be able to access that bucket). It's all "declarative" rather than "imperative" i.e. the configuration just describes all of the resources that ought to exist and you just have to put your faith in the Terraform gods that it will successfully convert whatever the current state of the system is to the desired state.
Whenever I have to do anything with Terraform configuration, I have the powerful feeling that I am a tiny ant in a colony. There are myriad configuration files which are way beyond my ken to comprehend. I just need to focus on my one little task (e.g. "why can't server X store a file in bucket Y") and try to figure out what it is about the configuration, as embodied in these files, that means that this is not working. All the time, I am paranoid that I will make some small mistake, and then the wonderful elegant declarative machinery will cheerfully migrate the infrastructure to a state where the main database has been destroyed.
Firstly,I miss the old days when there was a real server that you could talk to But I realise those days are gone and never coming back.
I don't much like declarative configuration of anything, because behind the scenes it's all necessarily imperative, and I don't like being insulated from that. On the other hand, migrating something from one state to another is a complicated process, and you can see how the declarative approach would be easier to develop and test. So maybe I just have to get used to being an ant.