Skip to main content

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:

  1. One or more .tf files — the Terraform definition of the infrastructure.
  2. One template.json file — 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 terraform CLI installed for offline validation (recommended).

How to Read This Section

PageWhen to read it
Quick-Start ScaffoldFirst. Copy-paste starter files for main.tf and template.json.
Writing the Terraform FilesRules Amnify imposes on your .tf files (no backend block, auto-injected variables, etc.).
template.json ReferenceThe complete schema — every field, required vs optional, every variable property.
Variable Types & SecretsDeep dive on string, number, bool, object, list(object), and how sensitive variables are encrypted.
Example — Azure Resource GroupA simple end-to-end walkthrough.
Example — AWS VPCAn advanced walkthrough showing nested objects, lists, options, and conditional fields.