Importance of ChatGPT in Cloud Formation:

Ghazanfar Ali
3 min readAug 24, 2023

--

Introduction:

In this concise blog post, we’ll explore the valuable role that ChatGPT can play for DevOps and cloud engineers seeking streamlined automation of cloud resources, particularly on AWS. Throughout the article, we’ll focus on a real-world application: “CloudFormation,” a powerful tool akin to Terraform that enables AWS automation.

Scenario:

We will set up an EC2 instance along with its own security group that lets traffic through ports 80 and 22. Here’s the cool part: we’re getting help from ChatGPT to create the exact YAML code we need for our CloudFormation stack. It’s even smart enough to pick the right AMI ID based on the region we’re working in. With ChatGPT by our side, we’re making our cloud resource management super smooth and tailor-fit to what we need.

Let do it!

First we will ask our requirement to chat gpt:

Chatgpt wrote the whole code for us we just changed the ami ids:

Now we will use this code in cloud formation stack:

Upload the code file that is written in yaml file:

check the events for fresh logs:

we have created our ec2 instance through cloud formation with required security group rules, cloud formation took the instance AMI id as per our region:

Security group rules:

This is how chatgpt can be helpful in automation but remember always learn to write YAML files by self first so it will help to to make changes or understand the yaml files.

--

--

Ghazanfar Ali
Ghazanfar Ali

Written by Ghazanfar Ali

I write technical blogs on DevOps and AWS, Azure and GCP

No responses yet