> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amnify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

```mermaid theme={null}
flowchart LR
    A["✍️ You author<br/>main.tf + template.json"]
    B["📦 git push<br/>to template repo"]
    C["🔄 Sync in Amnify"]
    D["🧩 Template appears<br/>in library"]
    E["🚀 Users create<br/>deployments"]

    A --> B --> C --> D --> E
```

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](/cspm-deploy/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

| Page                                                                                                | When to read it                                                                                               |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [Quick-Start Scaffold](/cspm-deploy/create-custom-templates/scaffold)                               | First. Copy-paste starter files for `main.tf` and `template.json`.                                            |
| [Writing the Terraform Files](/cspm-deploy/create-custom-templates/terraform-files)                 | Rules Amnify imposes on your `.tf` files (no backend block, auto-injected variables, etc.).                   |
| [template.json Reference](/cspm-deploy/create-custom-templates/template-json-reference)             | The complete schema — every field, required vs optional, every variable property.                             |
| [Variable Types & Secrets](/cspm-deploy/create-custom-templates/variable-types-and-secrets)         | Deep dive on `string`, `number`, `bool`, `object`, `list(object)`, and how sensitive variables are encrypted. |
| [Example — Azure Resource Group](/cspm-deploy/create-custom-templates/example-azure-resource-group) | A simple end-to-end walkthrough.                                                                              |
| [Example — AWS VPC](/cspm-deploy/create-custom-templates/example-aws-vpc)                           | An advanced walkthrough showing nested objects, lists, options, and conditional fields.                       |

***

## Related Reading

* [Using Templates](/cspm-deploy/guides/using-templates) — the consumer view: browsing, selecting, and modifying templates from the library.
* [Templates concept page](/cspm-deploy/concepts/templates) — high-level mental model.
