This chapter covers the core features and capabilities of Terraform Starter.
main.tf, variables.tf, outputs.tf, terraform.tfvarstfvars files (dev, staging, production)# Generate Terraform configs from the example spec
python src/terraform_generator.py --config examples/infra_spec.json
# Write to a target directory
python src/terraform_generator.py --config examples/infra_spec.json --output-dir ./terraform/
# Generate only specific components
python src/terraform_generator.py --config examples/infra_spec.json --components vpc,compute
# Validate config without generating
python src/terraform_generator.py --config examples/infra_spec.json --validate-onlyFollow this guide to get Terraform Starter up and running in your environment.
Create a JSON file with these fields:
| Field | Type | Required | Description |
|---|---|---|---|
project_name | string | Yes | Project name (used in resource naming) |
region | string | No | Cloud region (default: us-east-1) |
provider | string | No | Cloud provider: aws (default: aws) |
environments | array | No | Environments to generate tfvars for |
vpc | object | No | VPC config: cidr, public_subnets, private_subnets |
compute | object | No | Compute config: instance_type, count, ami |
database | object | No | DB config: engine, instance_class, allocated_storage |
storage | object | No | S3 config: bucket_name, versioning, encryption |
state_backend | object | No | Remote state: bucket, key, dynamodb_table |
tags | object | No | Default tags applied to all resources |
| Flag | Description |
|---|---|
--config, -c | Path to the JSON infrastructure spec (required) |
--output-dir, -o | Directory to write Terraform files (default: stdout preview) |
--components | Comma-separated list of components to generate |
--validate-only | Only validate config, don't generate |
--verbose, -v | Enable debug logging |
Get the full Terraform Starter and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.