Infrastructure as Code now with AI

The rapid of AI assisted tools has caused a lot of speculation and in my opinion, a lot of unfounded worry about the future of may infrastructure jobs.

One of, if not the first of the disruptors was GitHub’s CoPilot. With easy integration into pretty much any IDE and code editor, it brought a lot of capability but also a lot of worry about making many roles redundant.

Much the same happened some years ago when ‘Network Automation’ became ‘a thing’. Things did change, however again, in my opinion, they changed for the better.

Rather than the using ‘copy and paste’ from notepad to a SecureCRT window to one or several network devices, adding VLANs to trunks, or mass confirmation of switch ports; all of which were repetitive, mundane and error-prone activities, we got to focus on engineering.

Rather than interchange Network Automaton, IaC, Network as Code, for the remainder of this blog post I’ll just just IaC with the obcvious application to networking

  • HashiCorp Terraform uses HCL (HashiCorp Configuration Language)
  • AWS CloudFormation uses JSON or YAML
  • RedHat’s Ansible uses YAML

But I don’t have a coding background??

Firstly, IaC doesn’t mean having to be a programmer. There are levels of abstraction.

Domain Specific Languages (DSL) are used by some IaC frameworks are normally quick to learn and provide very powerful IaC capabilities.

Three of a few declarative frameworks that use DSLs which have a rapid ‘zero to hero’ learning curve:

  • AWS CDK (Cloud Development Kit)
  • HashiCorp Terraform CDKTF
  • Pulumi

Using a programming language where there is already a proficiency in the organisation, or having domain SMEs (networking of course) learn to program brings far more flexibility and capability to IaC.

Then we have new languages specific to IaC – Wing, this is going to be interesting.

 

But I need to go to a super expensive boot camp, learning to program is hard!!

Nowadays, learning to code to a decent level is easier than it used to be. We have access to SO many awesome courses that are either free or very affordable to most. Affordable in this scenario is around £20, the same as a sandwich and coffee in London.

I’ve got no CS degree, in fact my schooling yielded less than spectacular results. I admit to not being the smartest person in the room more often than not, and for various reasons often struggle to learn, BUT, I am very stubborn!

I have found a few amazing, trusted course authors I go back to time and time again for a variety of courses.

Whilst I would recommend learning one language to a very proficient level and then adding to it if needed, I’ve had to try to learn a few:

  • Python
  • Golang
  • TypeScript
  • Java

With great power comes great responsibility! AI joins the party

 I wanted to quote from Spider-Man – tick!

 

Using AI assisted tools such as:

  • GitHub CoPilot (soon CoPilot X)
  • AWS CodeWhisperer
  • Tabbing
  • Pulumi AI
  • InfraCopilot
  • ChatGPT
  • Many more to come….

We can embrace these tools, using them to assist us and often helping solve complex problems where we have a missing piece of the jigsaw we just can’t seem to make fit.1

 

Use it or abuse it

I have used at least a few of the tools above to increase productivity and learn a LOT along the way.

An example… I needed to collate some statistics and wanted (notice the difference between needed and wanted, the want often is more work than the need) to display them in a nice table, and hey, let’s add some colour.

I’ve used the rich Python library for a while and LOVE it, but never been very good at getting tables ‘just so’. I also had a requirement (self-imposed want) to be able to have a Flask app serve a pretty graph with the data that I could save as a file (png, pdf etc.).

I got the stats – tick.

Getting a pretty bar chart and ability to print the stats out in a nice table with colour and nice formattting was going to take a while and not something I desperately wanted to learn in depth right now.

I used ChatGPT to help build the formatting using Dash (a Ploty app using Flask) and as well as a bit of help with the formatting in a rich Live table.

The results were something I was really happy with, the bit that would have taken me AGES to do, took an hour or two and where I wanted to understand specifics, I just has to ask.

Think of it as a more interactive ‘Google-Fu/Stack Overflow’ query.

 

So what does this mean for IaC

Faster adoption, we can now use AI assisted tools to help learn tooling, as well as guidance when we have the annoying problem where we are ‘almost there’ (which normally means a late night is rapidly approaching) but not sure if the particular rabbit hole we are going down is the right one, of should we step back and explore another path.

Just as with AI assisted code, if we rely on these tools, we could have problems.

Limited learning and understanding

AI can return good code, and we can ask ‘what does x do?’ but without the trial and error, exploring options and often hitting a lot of dead ends, being told the answer and even an explanation with it doesn’t mean it will be remembered or even fully understood. How often when you’ve asked a question without the due dilligence and given an answer, do you then remember that months (or days) later? Or actually fully understood the ‘why’?

A self-imposed glass ceiling

Without putting in the hard work to learn something, instead relying on being given the answer will more often than not impose a self-inflicted glass ceiling on development.

 

Wait, what.. why did that happen at 2am??

Without fully understanding the output of AI assisted tools, or without the needed knowledge to actually ask the right questions… there could be unintended side effects, and normally not the nice type.

Without the time spent learning something and going down all those rabbit holes, ‘you don’t know what you don’t know’ so often don’t ask the right questions.

 

Enought Already!!

Yes, I know… I meant to write a paragraph or three at most and we are now looking more like a War and Peace novel.

For people who know me, and those that are kind enough to take time to read this far, you will realise I do love to talk (transposed to writing in this case) when I love a subject.

I will try to put a TL;DR paragraph in posts, but again, really hope that there is some merit in my scribbling and as always open to feedback and constructive criticism as that’s how we learn.

 

Watch this space

I’m pretty sure that AI is both here to stay and if embraced will make our roles enjoyable and full of learning, let’s watch this space together and take the journey to – who knows where… but as a community it’s going to be full of opportunities. As in most instance, the important part is the journey, not the destination.


Comments

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.