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: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. Thefeatures {}block is required by the provider (even when empty).subscription_idcomes 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 intemplate.json.variable "tags"is also auto-injected (project + deployment metadata). Declare it; do not duplicate it intemplate.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
resourceblock creates the resource group, applying the user’s chosen name, location, and Amnify-injected tags. - The
outputblocks 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 fromtpl-azure-my-resource-groupto 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.FolderOpenreads well for a “container” resource.variables— three entries:subscription_idis 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_nameis a free-text required field.locationis a required field with adefaultand anoptionsarray, 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
validate fails, the most common causes are:
- A variable name in
template.jsonthat is missing inmain.tf(or vice versa). - A typo in the provider version constraint or resource attribute.
- Missing
features {}block in theazurermprovider.
5. Publish
- Navigate to Deploy → Templates.
- Click Sync Templates.
- 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:- Example — AWS VPC —
list(object), nestedobject,min_items, deeply nestedlist(object), and option-driven enums. - template.json Reference —
condition,resource_type,parent_field. - Variable Types & Secrets —
sensitivevariables and the encryption flow.