ChatGPT Meets Terraform
A Revolution in Cloud Infrastructure Automation
Please note that this article is part of a series aimed at helping readers better understand the challenges of AI in the cloud computing industry. While I did not personally write this article with ChatGPT, all of the links provided contain accurate information that I have read online.
Suddenly, the world is abuzz with chatter about chatbots. Artificially intelligent agents like ChatGPT have displayed remarkable conversational abilities that mimic human behavior. It’s been fascinating to witness the proliferation of these new AI tools on social media platforms like LinkedIn, Medium, and Google News. However, as exciting as this moment may be, there’s also an element of fear. Given humanity’s history of mismanaging promising technologies, I’m hesitant to embrace this new wave of AI until we see its true potential.
Machine-learning forms of artificial intelligence are going to produce a revolution in computer systems, a new kind of hardware-software union that can put AI in your toaster, according to AI pioneer Geoffrey Hinton.
Setting aside a lot of the ethical issues and broader societal impacts, I’d like to narrow the focus to the world of cloud infrastructure, and even more narrowly to the wonderful world of Infrastructure-as-Code terraform. How will AI impact the world of Cloud Computing? How will AI impact how Terraform design systems are created and used?
While some answers to these questions may seem obvious, there are still many unasked questions and uncharted territories ahead. We’re navigating new waters, and the full scope of AI’s impact remains to be seen.
Tldr;
This article delves into the frontier of marrying ChatGPT’s linguistic prowess with Terraform’s robust infrastructure automation capabilities, forging a pathway towards more efficient, intelligent, and streamlined cloud management solutions.
- IaC, Terraform and the Cloud
- AI Artificial Intelligence, from 2022 to 2023
- AI Cloud Computing Trends 2023–2025
- Terraform AI: Use cases & tools
- The future of AI Infrastructure-as-Code
Terraform
Terraform is by far the best Infrastructure-as-Code framework. I’ve been working on Terraform for about one year now. I’ve seen thousands of use cases pass through Brainboard’s Slack channels. To name a few:
- Designing systems: Terraform is an important component of modern IT infrastructure. Designing an optimized system that make sure all these nodes are well connected to secure endpoints is the primarily concern of every cloud architect.
- Co-design: Designing infrastructure is rarely a solo job, at least not in modern organizations. The goal is to build components that others can use, but the expertise required to work with Terraform is often unbalanced and spread across different team members.
- Supercharge productivity: Terraform brought a tremendous increase of engineers’ velocity when designing, deploying and managing complex landing zones for example. The speed in which DevOps automate the provisioning of the infrastructure is critical to respond to companies’ most critical threats.
- Scaling: Startups can quickly become unicorns or tech leaders overnight, and the cloud and Terraform need to adapt to accommodate the scalability of these companies, regardless of cost, in order to reduce human error.
- Processes: The complexity of the cloud ecosystem can be overwhelming, making it difficult for people to choose the right processes, best practices, or tools. Infrastructure as Code (IaC) has brought some clarity to this confusion by creating a connection between the current state of the infrastructure in code and the desired state in a diagram. This relationship helps to simplify the decision-making process and enables faster, more effective decision-making.
Now that I put that out of the way, I had to try out ChatGPT’s latest release for terraform and it’s absolutely bollock:
- Learn by doing: Learning Infrastructure-as-Code (IaC) skills takes time and practice. One of the best ways to learn IaC is through use cases, fictive scenarios, or basic setups. ChatGPT is a great tool for this purpose, as it allows you to write anything to understand anything, which is the essence of learning by doing.
- Explain something: Understanding the interactions between different pieces of information, patterns, or data is key to moving your IaC projects forward. However, some barriers to coding may require you to learn to code first before managing cloud services and Terraform infrastructures on your own. While ChatGPT may have earned AWS’s Cloud Practitioner Certification, it cannot know your co-workers’ code history.
- Write code: Every code is different depending on who’s writing it, and errors are prone to happen. ChatGPT has proven to be helpful in writing cleaner code, especially when it comes to Terraform code. You can add notes everywhere or use a proper readme file to make the code more descriptive. This is the future of Integrated Development Environments (IDEs).
- Automate routine tasks: AI can also be used to automate routine tasks in IT management, such as resource allocation and scaling. Wherever there is a script, there could be an AI that can perform the task. It is expected that AI will get to the point where it takes less work to set up than a script.
- Find common errors: Finding a needle in a haystack is the #1 job of ChatGPT. ChatGPT is also useful in finding common errors, although it’s not recommended to share the entire code with it. Instead, it’s better to show the part of the code that may be causing the output error.
For more information, check out my previous published article:
AI (Artificial Intelligence)
The tech news cycle has been dominated by applications like ChatGPT, 1M users in under a week. But beyond the headlines, a wave of startups and tech giants have already entered the market and are rapidly expanding the use cases for generative AI, tackling everything from search engines to motion capture animation.
As Transformer-based language models (LLMs, GenAI, etc.) gain popularity, integrating them into modern applications presents unique engineering challenges. This document aims to address common pitfalls and establish mental models for experienced engineering leaders to effectively leverage LLMs in a sustainable way that minimizes technical debt.
GPT-4 represents a significant step change in foundation model capabilities, offering remarkable advancements in natural language processing, understanding, and generation. For our specific use-case of leveraging machine learning to automate and accelerate the venture capital process, GPT-4 has demonstrated its ability to meet or even exceed the performance of custom models we have spent months developing. — Moonfire
Artificial Intelligence has proven to be efficient in terms of producing great tangible results in many industries:
Find less & better results
AI is all about synthesising information versus modern search engines that confuse people with clickbait (Bard is testing Ads) and generative contents. New AI Search Engines like You.com emerge as leaders, combining the world of Google, ChatGPT and Bing AI. Don’t ever use ChatGPT to generate ChatGPT prompts, you may see yourself confused.
Content creation
Misinformation is already a trendy topic among researchers and professionals. With AI content generators, an article is rapidly published from draft. Marketing language models (like Charlie, Jasper) have already emerged replacing copyrighters, web designers, product marketers or journalists.
Generative AI
It’s purely arty farsty stuffs spread everywhere on the web. If you are an active Instagram, Twitter, or Pinterest user, you likely saw interesting artworks created using text-based tools like DALLE, Midjourney, or Stable Diffusion. From interior design, to 3D animation videos, to video makers, to Game designers, the industry promise to give designers the freedom they need to thrive.
Automating
AI will transform the Office Suite at work. That, tech giants made sure of it. Bringing ChatGPT to Google Office brought another level of automation possible, boosting engineers’ productivity. From APIs to complex workflows to open-source repos, the world is full of automation possibilities for anything. Welcome to AutoGPT: the next frontier of prompt engineering!
Expertise-driven
People talk about ChatGPT being really cool because it can write my high-school essay for me. Well, how about reducing hospital readmissions at MD Anderson by 30 percent? You decide which is more important,’— Oracle Chairman and CTO Larry Ellison
Fear of missing out, AI need to replace jobs as it’s journey crosses path with human. ChatGPT already passed written exams at top business, medical and law schools, among other feats both awe-inspiring and alarming.
Even though some are fearing AI will take over millions of jobs, expertise-driven AI will rise and help expertise-driven people.
One-click app
Elon Musk have already predicted that with X Corp. Is this the time where we finally see one app for everything or one app per category of everything? Meet AI x Adventure, AI x Finance x Bloomberg, AI x Photogrammetry
Software + Hardware
Virtual conversations are cool but what’s next for these beautiful conversations and outputs you generate with AI? Well, imagine Charater.AI meeting SoftBank, half way to a beautiful merge between humanoid-like robots and younger-self-back-to-life-as-an-AI-Chatbot.
Why not the Cloud Computing industry?
AI’s impact on the Cloud Computing industry is not yet measurable but tech giants are investing heavily on it. But Why? Be an industry leader.
To create these AI generative technologies, they need to be hosted somewhere and what better place to host secure data? Well… the Cloud!
- Amazon Web Services already unvealed Amazon CodeWhisperer, Bedrock and shown keen to invest heavily more on Machine Learning.
- Microsoft invested millions on Open AI so Azure is getting an AI-lift over. This is a history of Microsoft AI 2023’s AI release.
- Oracle is on a mission to become the ‘Netflix of AI’
- IBM unveils AI supercomputer in the cloud. Is it a preview of Skynet?
- Nvidia launches generative AI and supercomputing cloud services as part of their ‘new business model’.
Big tech, all with generative AI ambitions, will look for publishers to become exclusive to their AI agents to achieve 2 objectives — improve their models and weaken others by depriving them of access.
So if language acquisition costs emerge, who should big tech lock up?
AI Cloud Computing Trends 2023–2025
Before fearing ChatGPT, remember that Steve Jobs doubted the cloud, says NetSuite founder
Low Code is being independant
In general, Low-code means democratising the engineering knowledge to the rest of the world. From website builders to metaverse applications, low-code brought independence to many creators and innovators out there. It brought life to thousands of ideas that today generate millions of $.
Consume or customize?
With the availability of generative AI and language model (LLM) applications through APIs, companies can easily consume these technologies and tailor them to their specific use cases using prompt engineering techniques.
However, to fully leverage the benefits of these AI tools, most companies will need to customize the models by fine-tuning them with their own data. This customization will enable the models to support specific downstream tasks across the entire business, leading to increased efficacy in using AI to unlock new performance frontiers. By elevating employee capabilities, delighting customers, introducing new business models, and boosting responsiveness to signals of change, companies can stay ahead of the curve in today’s rapidly evolving business landscape.
Brainstorm Questions Not Ideas
We know for a fact that:
A picture is worth a thousands words.
We need to embrace the idea that cloud computing is a complex engine that drives most industries’ modern infrastructure. It’s important to ask the right questions in order to generate creative and effective ideas, modifications or improvements. These questions — “problem definition” questions, “what if” questions, and “provocative” questions, and provides specific examples of — can’t be answered by a robot without a proper 360 context.
When you design an infrastructure, everything is at stake. So asking the right questions may be the secret keys to unlocking AI’s full potential.
Wave 2: Less is more
I’ve read that AI could make things much simpler. Less is more right?
To date, generative AI applications have overwhelmingly focused on the divergence of information. That is, they create new content based on a set of instructions. In Wave 2, we believe we will see more applications of AI to converge information. That is, they will show us less content by synthesizing the information available. Aptly, we refer to Wave 2 as synthesis AI (“SynthAI”) to contrast with Wave 1. While Wave 1 has created some value at the application layer, we believe Wave 2 will bring a step function change. — For B2B Generative AI Apps, Is Less More? | Andreessen Horowitz
We might see chaos in the industry, like we see chaos in most industries. When it comes to AI, innovation or technology in general, it’s better to embrace it and use it best to automate things you don’t want to do and do things you do want to do.
About 99% of the time, the right time is right now.
We can’t predict when a technology become massive used by the Planet. There is no right or wrong time to launch something. So I guess that works for AI too. ChatGPT is most of the time right but it can be wrong. It all depends on the prompt and machine vision engine.
The danger isn’t that AI destroys us. It’s what it drives us insane. Don’t use ChatGPT for prompts that are not possible to do in the first place. Without the proper data, robots will not give accurate answers.
Terraform AI: Use cases & tools
As we see more successful use cases of AI in various industries, it raises the question of how to adapt ChatGPT or AI in general to Terraform development. Through my research, I have identified several proven trends in this area, including:
ChatGPT basic prompts
There is a common misconception among engineers that using ChatGPT or other AI models makes them appear less intelligent. However, this is far from the truth. ChatGPT is designed to provide quick answers to any query, which can save engineers a lot of time and effort. While the answer may not always be complete or 100% accurate, it can still provide a useful starting point for further research or investigation. In fact, using AI models like ChatGPT can help engineers become more efficient and effective in their work.
If you’re interested in exploring ChatGPT’s Terraform prompts, I suggest taking a look at these resources:
- [Tutorial] Using AI to write SQL and Terraform code by Recordly
- [Whitepaper] Generating Terraform Configuration Files with Large Language Models
- [Benchmark] AI-Generated Infrastructure-as-Code: The Good, the Bad and the Ugly
- [AWS use case] Using ChatGPT to Generate Terraform Code by LondonIAC / Dennis McCarthy / Automation Engineer
- [Azure use case] Using ChatGPT To Create An Azure DevOps Pipeline with Terraform in Deploying Azure Resources by Roy Kim
- [Cloud migration] Learn & Solve Terraform Issues using AI
- [Image-to-Code] SceneX plugin to add an image
- [Terraform] How often do you deploy to production? Automating safe, hands-off deployments
VSCode X ChatGPT
Can ChatGPT extension on Visual studio code write Hashicorp Terraform Configuration? Yes, ChatGPT extension on Visual Studio Code can write Hashicorp Terraform Configuration. There are multiple open-source repositories available on GitHub that allow developers to leverage the power of ChatGPT and generate Terraform configuration code.
Some of the popular repositories for ChatGPT extension on Visual Studio Code include:
Terraform New Provider: chatgpt — Hailey applied “chatgpt” module in terraform code that produces Vault cluster.
- Terraform Writer — Online AI Terraform module composer.
- InfraSketch — Drawing to Terraform, pretty need result.
- AI serverless pattern generator. This is a demo, it’s not yet out.
- InfraCopilot —We tried it internally. It still resolves basic configuration bottlenecks but with basic use cases, yet — on AWS only.
- K8sGPT — The Ultimate Tool for K8s Troubleshooting.
- Bits AI — Datadog’s own DevOps copilot to diagnose issues and determine their scope & investigate issues faster by surfacing key data & streamline incident response and remediation & prevent issues from reoccurring.
- Genie — the best one so far. View this tutorial here.
- tfgpt — CLI tool that integrates Terraform with OpenAI’s GPT.
- GitHubt Copilot — GitHub’s own AI copilot directly on GitHub
- GitGPT — Talk to any GitHub repo
- Structura.io — Create code based on your existing Terraform code or starting from scratch
- GPTDeploy — Build and deploy microservices
None solve the cloud ecosystem question:
With the right data, logic, and intelligence, the next-gen AI + Terraform solution could be the so called “the most advanced infrastructure design tool that understands how to define, connect, scale, deploy and manage your infrastructure-as-code”. We are not there yet.
What’s next? Brainboard AI
We are excited to announce the launch of Brainboard AI’s new feature, Bob, now available to our beta testers. Bob is designed to generate diagrams and Terraform code directly from your prompts. Please note that to generate valid Terraform code, your specific configurations are required.
Our team is committed to continuously improving and expanding this innovative tool. Interested in experiencing Bob’s capabilities firsthand? Join our beta testing program here.
If you think Brainboard is a match for your organization, contact us.
The future of AI Infrastructure-as-Code
These past few years, Infrastructure-as-Code have been shifting gears to a more efficient turn. But this question on Reddit arose debate: Why do we still use Terraform Cloud for our infrastructure?
New ways tend to bring things closer together. We must understand the importance of innovation in order to survive, vastly spread with glued processes, engineering bottlenecks and massive misinformation.
I, as Mike Tyson of the Cloud, forecast to see happen:
- This came true: Cloud vendors will need to continuously innovate and improve their services to stay ahead of the game. One example is the rise of TerraformGPT repositories on GitHub, which enable terraform-first prompts to be more experience-driven, reducing the need for manual terraform code or YAML syntax for CI/CD.
- While AI will lead to automation of many tasks, it will also create new job opportunities for AI engineers who are experts in data aggregation, production, and analysis. These experts will be in high demand and will play an important role in implementing automated cloud orchestration systems, managing big data, IoT, data governance, and cloud cost control.
- The integration of AI into cloud services will continue to increase, providing value-added features, creating new business models (Meet AI and IaaS, SaaS and PaaS) and streamlining human workflows.
- As the use of AI increases, visualizing existing terraform infrastructure will become more important, and a collaboration between ChatGPT, MidJourney, and Terraform can be leveraged to make this possible. Think of it like a Metaverse Architect job for the IT world. This World’s Infrastructure Manager will have to design, deploy and manage everything the company have in the Multi-Meta-Cloud verse. Exciting right?
- Making DevOps, SecOps or FinOps obsolete? The future of cloud infrastructure tools is exciting, with the potential for automation to optimize carbon footprint, security attacks (infosec), and inflation costs in real-time. However, offensive cyber operations may not be a reality yet, so let’s focus on the practical applications for now.
The rise of automation and AI has raised concerns about job displacement. According to CBInsights, robot automation may take 800 million jobs by 2030. However, it is important to note that new job opportunities will emerge with the advancement of technology. Therefore, we need to embrace the change and focus on upskilling ourselves to stay relevant in the job market.
⬇️⬇️ Drop your trend ideas below ⬇️⬇️