Can You Really Write Your DevOps Code Using ChatGPT?

Andrey Byhalenko
5 min readJust now

Many programmers and DevOps engineers write and debug their code using ChatGPT.

But can you really be sure in the accuracy when writing DevOps code using ChatGPT? How good is ChatGPT at coding?

Let’s check it out together.

I will use the ChatGPT 4o model in this article.

Not a member? Click here to read this article for free.

Photo by Jonathan Kemper on Unsplash

I will ask ChatGPT to write the Terraform file that would create the EC2 instance on AWS.

Here is the prompt:

Act as a senior DevOps engineer. Write the Terraform file that would create the Ubuntu 24.04 EC2 instance. Use Terraform 0.13 syntax.

Here is the Terraform file that ChatGPT created in a matter of seconds:

# Specify the provider
provider "aws" {
region = "us-east-1" # Replace with your desired AWS region
}

# Define a security group
resource "aws_security_group" "ec2_security_group" {
name = "allow_ssh"
description = "Allow SSH traffic"

ingress {
from_port = 22
to_port…

--

--

Andrey Byhalenko
Andrey Byhalenko

Written by Andrey Byhalenko

I'm a DevOps Engineer, Photography Enthusiast, and Traveler. I write articles aimed at junior DevOps engineers and those aspiring to become DevOps engineers.

No responses yet