๐Ÿ—๏ธ Terraform Config Generator

Visually create Terraform HCL config files with AWS/Azure/GCP cloud resource definitions.

Zero Dependencies ยท Works Offline

โ˜๏ธ Cloud Platform & Provider

๐Ÿ“ฆ Resources

๐Ÿ“„ Generated Config

What Can the Terraform Config Generator Do?

The Terraform Config Generator is a free online tool that helps DevOps engineers and cloud architects visually create Terraform HCL configuration files. It supports AWS, Azure, and GCP cloud platforms. Use the form interface to select resource types and configure parameters, and the tool automatically generates standard HCL format Terraform configurations. No need to write HCL by hand โ€” lower the IaC barrier and improve configuration writing efficiency.

Core Features

How to Use

1. Select cloud platform (AWS/Azure/GCP) and region

2. Fill in project name and environment

3. Click "Add Resource" to select resource type and configure parameters

4. Use "Common Combo" to quickly add resource groups

5. Generate config then copy or download main.tf

Use Cases

Case 1: Quick Prototyping

Developers quickly generate Terraform config prototypes, then refine and adjust, shortening infrastructure setup time.

Case 2: IaC Learning

Terraform beginners use the visual interface to understand HCL syntax and resource configuration structure, learning by doing.

Case 3: Standardized Templates

Teams use a unified config generator to create standardized infrastructure templates, ensuring configuration consistency and best practices.

Extended Knowledge

Terraform is an open-source Infrastructure as Code (IaC) tool by HashiCorp that uses HCL (HashiCorp Configuration Language) to declaratively define cloud resources. Core concepts include Provider (cloud platform plugin), Resource (resource definition), Variable (variables), Output (output values), State (state management), and Module (modularization). The Terraform workflow is terraform init โ†’ plan โ†’ apply: first initialize to download providers, then preview changes, and finally apply. HCL combines JSON's machine readability with human readability, supporting variable interpolation (${var.name}), conditional expressions, for loops, and other features.

FAQ

What is Terraform?โ–ผ
Terraform is an Infrastructure as Code (IaC) tool by HashiCorp that uses HCL to declaratively define cloud resources. It supports AWS, Azure, GCP and other major cloud platforms for version-controlled infrastructure management.
What is HCL?โ–ผ
HCL (HashiCorp Configuration Language) is Terraform's config language, combining JSON's machine readability with human readability. It supports variables, conditions, loops and other programming features.
Which cloud platforms are supported?โ–ผ
AWS, Azure, and GCP are supported with common resource templates for each: EC2, S3, RDS (AWS), VM, Storage Account (Azure), Compute Engine, Cloud Storage (GCP).
Can I use the generated config directly?โ–ผ
The generated config is standard HCL format, ready for terraform init/plan/apply. However, we recommend adjusting variable values and resource parameters for your actual environment.
Is my data uploaded to any server?โ–ผ
No. This tool runs entirely in your browser. All config generation is done client-side with no data uploaded to any server.

Terraform Config Generator | No Signup, Client-Side ยท No Server Uploads

Feedback: dexshuang@google.com

${resInfo.fields.map(f=>`
`).join('')}
`;}).join('');} function generate(){const p=document.getElementById('provider').value;const region=document.getElementById('region').value;const project=document.getElementById('project-name').value;const env=document.getElementById('environment').value;if(resources.length===0){document.getElementById('config-text').textContent='# Click "Add Resource" to start configuring';return;}const lines=[];lines.push(`# Terraform Configuration for ${project} (${env})`);lines.push(`# Generated by Free ToolBase Terraform Config Generator`);lines.push('');lines.push(`terraform {`);lines.push(` required_version = ">= 1.0"`);lines.push(` required_providers {`);lines.push(` ${p} = {`);lines.push(` source = "${p==='aws'?'hashicorp/aws':p==='azurerm'?'hashicorp/azurerm':'hashicorp/google'}"`);lines.push(` version = "~> ${p==='aws'?'5.0':p==='azurerm'?'3.0':'5.0'}"`);lines.push(` }`);lines.push(` }`);lines.push(`}`);lines.push('');lines.push(`provider "${p}" {`);if(p==='aws')lines.push(` region = var.aws_region`);else if(p==='azurerm')lines.push(` features {}`);else if(p==='google')lines.push(` region = var.gcp_region`);lines.push(`}`);lines.push('');lines.push(`variable "environment" {`);lines.push(` description = "Environment name"`);lines.push(` default = "${env}"`);lines.push(`}`);lines.push('');if(p==='aws'){lines.push(`variable "aws_region" {`);lines.push(` default = "${region}"`);lines.push(`}`);}else if(p==='google'){lines.push(`variable "gcp_region" {`);lines.push(` default = "${region}"`);lines.push(`}`);}lines.push('');resources.forEach(r=>{lines.push(`resource "${p}_${r.type}" "${r.name}" {`);if(p==='aws'&&r.type==='ec2'){lines.push(` ami = "${r.fields.ami||'ami-0c55b159cbfafe1f0'}"`);lines.push(` instance_type = "${r.fields.instance_type||'t3.micro'}"`);lines.push(` tags = { Name = "${r.name}", Environment = var.environment }`);}else if(p==='aws'&&r.type==='s3'){lines.push(` bucket = "${r.name}-${project}"`);lines.push(` acl = "${r.fields.acl||'private'}"`);}else if(p==='aws'&&r.type==='rds'){lines.push(` engine = "${r.fields.engine||'mysql'}"`);lines.push(` instance_class = "${r.fields.instance_class||'db.t3.micro'}"`);lines.push(` allocated_storage = ${r.fields.allocated_storage||20}`);lines.push(` username = "admin"`);lines.push(` password = var.db_password`);}else if(p==='aws'&&r.type==='vpc'){lines.push(` cidr_block = "${r.fields.cidr_block||'10.0.0.0/16'}"`);lines.push(` tags = { Name = "${r.name}" }`);}else if(p==='aws'&&r.type==='lambda'){lines.push(` function_name = "${r.name}"`);lines.push(` runtime = "${r.fields.runtime||'python3.9'}"`);lines.push(` handler = "${r.fields.handler||'index.handler'}"`);}else{Object.entries(r.fields).forEach(([k,v])=>{lines.push(` ${k} = "${v}"`);});}lines.push(`}`);lines.push('');});lines.push(`output "environment" { value = var.environment }`);document.getElementById('config-text').textContent=lines.join('\n');} function addPresetResources(){resources=[];resId=0;addResource('vpc');addResource('ec2');addResource('s3');} function loadExample(){document.getElementById('provider').value='aws';document.getElementById('region').value='us-east-1';document.getElementById('project-name').value='web-app';document.getElementById('environment').value='prod';resources=[];resId=0;addResource('vpc');addResource('ec2');addResource('s3');addResource('rds');updateResourceTypes();generate();} function copyConfig(){const text=document.getElementById('config-text').textContent;navigator.clipboard.writeText(text).then(()=>{const t=document.getElementById('copy-toast');t.classList.add('show');setTimeout(()=>t.classList.remove('show'),2000);});} function downloadConfig(){const text=document.getElementById('config-text').textContent;const blob=new Blob([text],{type:'text/plain'});const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download='main.tf';a.click();} function toggleFaq(el){el.parentElement.classList.toggle('open');} document.addEventListener('keydown',function(e){if(e.ctrlKey&&e.key==='Enter'){copyConfig();e.preventDefault();}if(e.ctrlKey&&e.shiftKey&&e.key==='C'){copyConfig();e.preventDefault();}}); updateResourceTypes();generate();