Terraform Config Generator

Generate Terraform provider, resource, variable and output blocks in your browser.

  • Runs locally in your browser
  • No upload required

Try it

File
main.tf
Blocks
required_providers, provider, variable.region, variable.bucket_name, resource.aws_s3_bucket, output.bucket_id
Content
# Generated in the browser — review this file and adapt it to your project before committing. terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } } provider "aws" { region = var.region } variable "region" { type = string } variable "bucket_name" { type = string } resource "aws_s3_bucket" "main" { # Reference declared inputs; never hardcode a credential here. region = var.region bucket_name = var.bucket_name } output "bucket_id" { value = aws_s3_bucket.main.id }
# Generated in the browser — review this file and adapt it to your project before committing.
terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

provider "aws" {
  region = var.region
}

variable "region" {
  type = string
}

variable "bucket_name" {
  type = string
}

resource "aws_s3_bucket" "main" {
  # Reference declared inputs; never hardcode a credential here.
  region = var.region
  bucket_name = var.bucket_name
}

output "bucket_id" {
  value = aws_s3_bucket.main.id
}

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Generated a Terraform module skeleton with 6 block(s).

How it works

  • Declared the aws provider and its required provider source.
  • Wrote one variable block per declared input.
  • Added a aws_s3_bucket resource that references the variables with var.*.
  • Wrote one output block per declared output.
  • Review attribute names and types against your provider before applying.
  • Run `terraform fmt -check` and `terraform validate` yourself.

Methodology

  1. Validate the provider, identifiers and version token.
  2. Emit `terraform.required_providers` and a provider block.
  3. Emit one variable per declared input, a resource referencing `var.*`, and one output per declared output.

Usage

  1. Choose a provider and optional version constraint.
  2. Name the resource type and local name.
  3. List variables and outputs, then copy the generated main.tf.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

AWS S3 module skeleton

jsonSelect to copy
{
  "provider": "aws",
  "providerVersion": "~> 5.0",
  "region": "us-east-1",
  "resourceType": "aws_s3_bucket",
  "resourceName": "main",
  "variables": "region, bucket_name",
  "outputs": "bucket_id"
}

Limitations

A module skeleton, not a plan

The generator writes the scaffolding you would otherwise type: the required providers block, variables, a resource and outputs. It cannot know your provider's exact arguments, so review them before running `terraform plan`.

Frequently asked questions

Does the generator embed cloud credentials?
No. The provider block references `var.region` and the resource references declared variables; credentials belong in your environment or a secret manager.
Which providers are supported?
aws, google, azurerm, kubernetes and null; other providers can be edited in by hand.

Sources

  1. Terraform language documentation — HashiCorp