OCInfrastructure, CustomGPT
Simplifying infrastructure creation in OCI with custom GPT
As we’ve seen in previous articles, ARENA continues to drive financial innovation by integrating artificial intelligence (AI) into the development of solutions for our clients. One of the goals of our “AI Lab” program is to explore practical applications of machine learning and natural language processing in the financial sector.
This article, part of our series of technical publications, presents a practical case study that optimizes the creation of Infrastructure as Code (IaC) using artificial intelligence and Terraform. The key aspects of the process are the automation of infrastructure deployment on Oracle Cloud Infrastructure (OCI) and the validation of Terraform scripts generated by a custom GPT.
At ARENA, we adapt emerging technologies to create innovative FinTech solutions. This project reflects our commitment to the technology community and our mission to drive the practical adoption of AI solutions in the financial sector.
In the age of automation and the cloud, infrastructure management is a challenge. Custom GPTs, such as “IaC Master Architect,” streamline these processes by generating complete Terraform scripts from network diagrams and natural language instructions. This saves time, reduces errors, and follows IaC best practices.
What is "Ia C Master Architect"?
“Ia C Master Architect” is a GPT (Global Platform Tool) specializing in creating Terraform scripts for OCI (Operational Cloud Infrastructure) and multicloud environments. This tool can analyze network diagrams or interpret natural language instructions, generating optimized Terraform scripts ready for deployment.
Its purpose is to make cloud infrastructure deployment fast, efficient, and error-free, following best practices to ensure scalability and easy maintenance.
Practical Case: Generating Infrastructure from a Diagram
In this lab, we’ll start with an OCI network diagram featuring multiple Availability Domains, private and public subnets, a high-availability RAC database, and a bastion server.
The goal is to generate a Terraform script using Generative AI capabilities and then run it on an OCI environment. This approach will offer several benefits, including saving time in infrastructure creation and eliminating potential human errors during the creation process.
The initial network diagram is shown below:
The process of generating the Terraform script is simplified using the “IaC Master Architect” tool. We only need to provide the following instructions:
• Analyze the OCI infrastructure in the diagram.
• Adapt the infrastructure to the Madrid region, which has one Availability Domain and three Fault Domains.
• Design the IP ranges for the necessary subnets, following best practices for a proof of concept (POC).
• Generate the complete Terraform script, with comments and deployment instructions.
Adaptation to the Madrid Region
The original diagram used two Availability Domains (ADs), but the Madrid region in OCI only has one AD and three Fault Domains (FDs). To ensure high availability, the GPT distributes infrastructure resources across the three FDs.
For example, instead of using multiple ADs for the RAC database, it is deployed across the Fault Domains within the single AD, maintaining the same resilience as the original design.
IP Ranges and Subnets
During infrastructure design, private IP address ranges are implemented following best practices for a proof of concept. The Virtual Cloud Network (VCN) uses the 10.0.0.0/16 range, subdividing it into subnets. Each subnet is appropriately segmented to ensure security and scalability, with security rules restricting access based on requirements.
Excerpt from the Generated Terraform Script
This code creates a Virtual Cloud Network (VCN) and an Internet Gateway (IGW), providing internet access for public resources. In addition, public and private subnets, a bastion server, and a distributed RAC database across two nodes were generated.
Validation and Deployment
The script was validated using validiac.com, which confirmed that the code is valid for deployment to OCI. This ensures a smooth and error-free deployment process.
Once validated, the GPT also provides the necessary instructions for deploying the infrastructure:
Efficient Automation with GPT
The GPT “Ia C Master Architect” demonstrates how automation can transform complex infrastructure processes. What previously required hours of analysis and manual Terraform scripting can now be accomplished in minutes, and with greater accuracy.
Key Benefits:
- Efficiency: Accelerates deployment time and eliminates manual errors.
- Flexibility: Automatically adapts to regional characteristics, such as Fault Domains.
- Scalability: Generates modular scripts that follow Infrastructure as a Community (IaC) best practices.
With tools like this, companies can optimize their cloud deployments, reduce downtime, and focus on innovation, instead of wasting time manually managing infrastructure.