Skip to main content
This is a complete walkthrough of authoring the simplest possible useful template: a single Azure Resource Group. The files match the shipped tpl-azure-resource-group verbatim, so you can copy them, change the id, and ship. By the end of this page you will have a working template that:
  • Provisions one azurerm_resource_group.
  • Lets the user name it.
  • Lets the user pick from a curated list of Azure regions.
  • Surfaces the resource group ID, name, and location as outputs.

1. Directory Layout

In your template repository:
The directory name (my-resource-group) is what users will see in the URL slug. Keep it short and snake-case.

2. main.tf

What is happening, block by block

  • The terraform { required_providers } block pins the Azure provider to ~> 4.0. This locks the major version while allowing minor and patch updates.
  • The provider "azurerm" block configures Azure. The features {} block is required by the provider (even when empty). subscription_id comes from a variable so each deployment can target a different subscription.
  • variable "subscription_id" is auto-injected by Amnify from the project’s environment config. It must be declared but does not appear in template.json.
  • variable "tags" is also auto-injected (project + deployment metadata). Declare it; do not duplicate it in template.json.
  • variable "resource_group_name" is the only field the user must fill in.
  • variable "location" is also user-facing, but has a sensible default ("West Europe").
  • The resource block creates the resource group, applying the user’s chosen name, location, and Amnify-injected tags.
  • The output blocks expose three values to Amnify after apply. Users see them on the deployment run page.

3. template.json

What is happening, field by field

  • id — change this from tpl-azure-my-resource-group to whatever stable identifier you want. It must be unique within your organization.
  • name — display name on the template card.
  • description — shown beneath the name in the library and on the deployment wizard.
  • category: "infrastructure" — categorizes the template under “Infrastructure” in the library filter.
  • cloud_provider: "azure" — must match the parent directory.
  • iac_type: "terraform" — only supported value today.
  • icon: "FolderOpen" — any Lucide icon name. FolderOpen reads well for a “container” resource.
  • variables — three entries:
    • subscription_id is exposed as a required field so the user picks the subscription. (Some templates omit this and rely entirely on the project’s auto-injection — both patterns work.)
    • resource_group_name is a free-text required field.
    • location is a required field with a default and an options array, so it renders as a dropdown of Azure regions.
Notice that tags is in main.tf but not in template.json. That is intentional — Amnify auto-injects tags. Adding it to template.json would force users to fill it in by hand for every deployment.

4. Validate Locally

Expected output:
If validate fails, the most common causes are:
  • A variable name in template.json that is missing in main.tf (or vice versa).
  • A typo in the provider version constraint or resource attribute.
  • Missing features {} block in the azurerm provider.

5. Publish

Then in Amnify:
  1. Navigate to Deploy → Templates.
  2. Click Sync Templates.
  3. Your new template appears in the library within a few seconds, ready for users to deploy.

What This Template Does Not Cover

This is an intentionally minimal example. To explore the full set of features Amnify supports, work through: