Will ChatGPT kill DevOps teams?

Amit Patil
Engineered @ Publicis Sapient
6 min readApr 28, 2023

ChatGPT is breaking the Internet. Since its launch, it has garnered billions of hits and made history as the fastest-growing platform. Per UBS Analysts, “In 20 years following the internet space, we cannot recall a faster ramp in a consumer internet app”. Till last year, Gartner Hype Cycle 2022 quoted that a foundational model based on transformer architecture-based models like LLM would take at least 5-10 years to develop and be of some use. But ChatGPT shattered their verdict.

The AI Chatbot’s ability to generate articles, essays, scripts and poetry, and mimic human behavior while responding to questions has made it a hit among users. In today’s blog, let us evaluate whether ChatGPT can replace the DevOps engineer’s role soon.

What is ChatGPT?

ChatGPT (Chat Generative Pre-trained Transformer) is a chatbot developed by OpenAI and launched in November, 2022. It’s a language model trained on a large corpus of text data, allowing it to generate human-like responses to various types of prompts. ChatGPT aims to respond to text-based input in a manner that simulates a conversation with a knowledgeable and helpful human. The model has been trained on diverse topics and can respond to questions and generate text on many subjects, including history, science, current events, and more.

How does it work?

ChatGPT is a deep learning model based on transformer architecture. It uses a combination of self-attention mechanisms and fully connected layers to generate text. Here’s a high-level overview of how ChatGPT works.

fig1

In summary, ChatGPT has been trained on a large corpus of text data, allowing it to learn patterns and relationships between words and phrases. This allows it to generate human-like text that is coherent and relevant to the input provided.

My experiments with ChatGPT

Let’s start with our experiment with ChatGPT and find out how this will transform the role of the DevOps Engineer. To begin, let’s keep it simple and gradually increase the complexity.

Use Case 1:

Explanation: Like any human, ChatGPT defined terraform covering its definition, origin, company details, usage, etc.

Explanation: When I appended some additional details to my previous questions, like any human, ChatGPT shared details on it and appended the response with details on ‘How I can apply Terraform in my job’ effectively.

Let’s look at some real-world stuff and ask ChatGPT to produce some code for us that we see in our day-to-day projects:

Use Case 2:

Explanation: In this code, we are using the “aws_iam_user” resource to create 10 IAM users on AWS. The count attribute specifies the number of users to create, and we have set it to 10. We have also specified a name for each user, using the index of the loop to generate a unique name (user1, user2, etc.). We have also specified a path to organize the users in a specific folder (/my-users/).

Challenges:

  1. Think of a real-world scenario, we are hardly going to see names like user1–2.
  2. IAM users have no permission whatsoever, hence we need to create and attach a policy.
  3. Security compliance is not considered e.g., least privileges, restrictive access, etc.

Use Case 2.1: Let's fix this code and convert it into a real-world use case.

Explanation:

This code defines a list variable named iam_users with the two IAM user names, “Amit” and “Ajit”. Then, it defines an IAM policy document using the aws_iam_policy_document data source, which allows us to define an IAM policy document as code. The policy document allows the ec2:Describe* action for all resources. Next, we create an IAM-managed policy using the aws_iam_policy resource, which uses the policy document created with aws_iam_policy_document as its policy.

Then, we create the IAM users using the aws_iam_user resource with the count parameter set to the length of the iam_users variable. This will create two users with the names “Amit” and “Ajit” as specified in the iam_users variable.

Finally, we use the aws_iam_user_policy_attachment resource to attach the IAM-managed policy created earlier to the two users using the count parameter set to the length of the iam_users variable. This will attach the policy to both “Amit” and “Ajit”.

We matured the script with some specific instructions to ChatGPT without which the code is non-deployable in any environment.

How to maximize the outcome?

  1. Specify Versions: If you want ChatGPT to generate configuration based on a terraform (for example) that may have multiple versions, I’ve found that it doesn’t always take the latest by default. It can be helpful to include the version of the configuration you want in the request to get more accurate results.
  2. Trust, but verify: As the quote goes, “Trust, but verify”, you can trust that the output that ChatGPT is giving you is good and error-free. But as with any code obtained online, you should always read through it yourself and ensure you understand it before adding it to your project. Never assume that the code generated by ChatGPT, no matter how amazing or excellent, is production-ready out-of-the-box.
  3. It can be your co-pilot: ChatGPT can be your co-pilot, but you cannot give the pilot your driving seat. It can help you with pair programming and be your first reviewer before you ship your code upstream.
  4. Give examples: Like in the above case, we provided specific details to ChatGPT, it can be helpful to provide more information when asking ChatGPT something. This can also be done in the form of giving it an example.
  5. It can help improve efficiency: We have seen how easier it was for me to generate the terraform code for provisioning resources on AWS. This can definitely help Engineers to be productive and improve their efficiency.

Summary:

ChatGPT keeps improving, but is still far from perfect. But it is here to stay. This is just the beginning and there is more to come. In its current state, it can help engineers increase their productivity and help unblock themselves in ways that may have taken days or multiple people’s assistance previously. But mind you, they are not a replacement for human expertise and judgment. ChatGPT is like an intelligent kid, who has knowledge, but still has a long way to go in acquiring wisdom and still needs development on topics like piracy, compliance, and security.

--

--

Amit Patil
Engineered @ Publicis Sapient

I am an engineer by heart, who enjoys building & help accelerate the Engineering transformation. I love to travel, read books, cook & eat diverse food.