Create Custom Templates
Amnify Deploy syncs templates from a GitHub repository that your organization owns. That means you can add your own infrastructure blueprints — anything Terraform can express — and they will appear in the template library next to the templates that ship with Amnify.
This section walks you through everything you need to author a new template from scratch: the file layout, the main.tf rules, the template.json schema, the variable types Amnify understands, and two complete worked examples (Azure Resource Group and AWS VPC).
What a Template Is, Concretely
A template is a directory in your GitHub repository that contains:
- One or more
.tffiles — the Terraform definition of the infrastructure. - One
template.jsonfile — a manifest that tells Amnify how to render the input form, validate user input, store secrets, and wire up cloud-resource pickers.
Amnify renders the UI and validates user input from template.json; it executes terraform against your .tf files. The two files are paired, and variable names must line up between them.
How Templates Flow Into Amnify
The sync is manual — Amnify does not auto-pull from GitHub. After pushing, click Sync Templates in the Amnify UI to make new or updated templates available.
Prerequisites
Before authoring your first template, make sure:
- Your organization has a synced GitHub template repository. See Integrations → GitHub for the connection setup.
- You have write access to that repository (or can open a pull request against it).
- You are comfortable writing Terraform for the resources you intend to provision.
- Your local machine has the
terraformCLI installed for offline validation (recommended).
How to Read This Section
| Page | When to read it |
|---|---|
| Quick-Start Scaffold | First. Copy-paste starter files for main.tf and template.json. |
| Writing the Terraform Files | Rules Amnify imposes on your .tf files (no backend block, auto-injected variables, etc.). |
| template.json Reference | The complete schema — every field, required vs optional, every variable property. |
| Variable Types & Secrets | Deep dive on string, number, bool, object, list(object), and how sensitive variables are encrypted. |
| Example — Azure Resource Group | A simple end-to-end walkthrough. |
| Example — AWS VPC | An advanced walkthrough showing nested objects, lists, options, and conditional fields. |
Related Reading
- Using Templates — the consumer view: browsing, selecting, and modifying templates from the library.
- Templates concept page — high-level mental model.