GUI is good, but big guys want IaC

It was getting dark, freezing rain was falling… it was the 7th year of development of Roxy-WI. Understanding the need for automation came a long time ago, so an API was developed. It was, let's say, crooked and illogical in places, but it worked. After creation RMON and writing a “normal” API for it, it was decided to create an API for Roxy-WI with CRUD and Swagger support.

Roxy-WI Swagger

Roxy-WI Swagger

After consulting with experienced API developers, the decision was made to write it in Flask using views and switch to JWT authorization. The old API was developed in the Bottle framework, but since Roxy-WI was rewritten in Flask, having two frameworks in one project did not seem like a good idea. At that time, I had already learned Flask quite well. JWT was introduced to combine authorization in the WEB version and the API, since previously the API used self-written authorization.

And now, a month later, version 8 was released! In addition to API and JWT, validation of incoming data based on Pydantic. Pydantic turned out to be a very powerful tool, but I resisted using the library for a very long time – I don’t know why anymore. And now, the API is ready, but documentation is needed, so Swagger was needed. I didn’t want to describe the structure myself a little bit (very much, damn, how much, I’m not a YAML developer). And I decided to try the AI ​​offered by JetBrains for $10. per month (am I crying in vain?!). So, robots will not enslave us anytime soon and will not leave us without work :-p. In the end it worked out, although I had to swear for a couple of evenings.

The API is ready, which means it’s time to write a Terraform provider. After studying the issue, I came to the conclusion that the provider cannot be written in Python – only in Go. I got upset and turned to @Rocky_Break for help. Rocky_Break wrote the first version of the provider and sent me a book on Go. It turned out that it is not enough to write an API; it must also be consistent. Whether it’s long or short, the first version was released and there I was already involved in the development of the provider (it’s so inconvenient to write in Go, after Python :`( ).

By the way! In order to be able to manage HAProxy completely in terraform, it was necessary to improve the work with HAProxy configurations – now after “clicking” on the config, you can also change it with clicks.

So now there is an IaC way for creating HA clusters with the ability to create UDP and HAProxy balancers ;).

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *