This is a submission for the GitHub Copilot Challenge : New Beginnings
What I Built
When we are deploying an application, especially in a cloud environment, we often need to manage the various infrastructure components, such as VPC, Servers, Databases, CDN, etc. Doing this manually is somewhat time-consuming and challenging. To overcome this, we can use terraform.
Terraform allows the development of the architecture that deploys the application in a cloud environment.
But writing the terraform is also somewhat time-consuming we need to create those codes manually, plus we need to know the terraform.
Using this Terraform-CodeGen0 you can easily generate the terraform codes. All you need to input the VPC name, Subnets, Route Tabels, IGW, and NAT details into this application. This Terraform-CodeGen0 provides your terraform code.
Demo
Repo
RandiakM / Terraform-CodeGen0
GitHub Copilot 1-Day Build Challenge: This is a Terraform Code generation application for VPC
VPC Terraform Generator
Introduction
The VPC Terraform Generator is a tool designed to generate Terraform code for AWS infrastructure components such as VPCs, Subnets, Route Tables, Internet Gateways (IGWs), and NAT Gateways. This project uses a microservices architecture and is hosted on Netlify, with MongoDB as the database.
How to Use
The VPC Terraform Generator allows users to generate Terraform code for various AWS components through a web interface. Users can input the necessary details for each component, and the application will generate the corresponding Terraform code.
Installation Steps
- Clone the repository:
git clone https://github.com/your-repo/vpc-terraform-generator.git
cd vpc-terraform-generator
- Install backend dependencies:
cd api
npm install
- Install frontend dependencies:
cd ../frontend
npm install
- Set up environment variables: Create a .env file in the api directory with the following content:
MONGODB_URI=your_mongodb_connection_string
- Start the backend server:
cd ../api
npm run dev
- Start the frontend server:
cd ../frontend
npm start
Netlify Hosting Steps
-
Create a…
Copilot Experience
So for the initial start, I have used the below prompt to get an idea of this project.
Build a Terraform code generator for AWS infrastructure components (VPCs, Subnets, Route Tables, IGWs, NAT, etc.) using a microservices architecture. The application will be hosted on Netlify, and MongoDB will be used as the database.
Starting project structure:
Terraform Code Generation:
Ask to implement the utility functions to generate Terraform code-based user inputs for each resource type.
Edits:
Auto Complete:
For this code auto-completion, I provide the description as a comment and start to create the function, then Copilot starts suggesting the code sections that are related to my task.
Documentation Creation:
Used the below prompt:
@workspace create a README with the below details:
1. Introduction
2. How to use
3. Installation Steps
4. Netlify Hosting Steps
5. User guide
Conclusion
Through this challenge and the journey, Copilot was an AI pair programmer who helped me build this application. From the start and even from the ending of this project Copilot was really helped me.
Copilot reviewed the codes and provide alternative solutions to overcome some issues when developing this application.
With the help of Copilot I was able to create this amazing application within just 24 hours, Wihtout copilot help this may take long.
Top comments (0)