Link Search Menu Expand Document

Terragen

Backdrop

  • The idea of Terragen was born while reading and working on several other terraform providers.
  • The initial version of the Terragen was just a one-time scaffold generator for Hashicorp terraform custom provider with limited features.
  • While working on operators for Kubernetes bumped on to frameworks such as Kubebuilder and operator-sdk.
  • The idea for the latest version of Terragen is derived from such frameworks.

Prerequisites

  • Go 1.12 or above . Installing go can be found here.
  • Basic understanding of terraform provider and creating one of them.

Terragen

terragen --help would help in listing all available commands and flags of Terragen.

Terragen helps user to create custom terraform provider and its components by generating scaffolds.

Usage:
  terragen [command] [flags]

Available Commands:
  create      Command to scaffold provider and other components of terraform provider
  edit        Command to edit the scaffold created for a provider
  help        Help about any command
  version     Command to fetch the version of terragen installed

Flags:
      --dry-run       dry-run the process of provider scaffold creation
  -h, --help          help for terragen
  -p, --path string   path where the templates has to be generated (default ".")


Use "terragen [command] --help" for more information about a command."

Other Components

Other than project scaffolds, terragen generates additional files. Below are the list of those and its usage:

  • Makefile: Along with regular scaffolds generated for a project, terragen generates makefile with minimal make targets to ease the development.
  • terragem.yml: This is a metadata generated by terragen to track all created/updated components and also project’s compatibility with other versions of terragen.