Skip to main content
Drop these two files into templates/<provider>/<my-template>/ in your template repository, edit the placeholders, push, and trigger a sync. You will have a working custom template in minutes. This page is the fastest path to “something that runs”. The pages that follow (Writing the Terraform Files, template.json Reference) explain the why and the full schema.

Directory Layout

The templates/<provider>/<name>/ shape is required — Amnify discovers templates by walking this exact structure.

Skeleton main.tf — Azure


Skeleton main.tf — AWS

Do not declare a terraform { backend "..." } block. Amnify injects the remote state backend at runtime during terraform init. Adding your own backend will be overwritten or cause init to fail.

Skeleton template.json

Replace the placeholders:

How a Variable Connects Across Both Files

Every variable lives in two places: declared in main.tf and described in template.json. The name must match exactly. Here is the canonical pattern for a sensitive (secret) variable:
What happens at runtime:
  • The user types a value into a masked input in the Amnify UI.
  • Amnify encrypts the value with AES-256-GCM, scoped per organization, before storing it.
  • During deployment, the worker decrypts the value in memory and writes it into terraform.tfvars.json alongside the non-sensitive variables.
  • The plaintext is never persisted — only the encrypted ciphertext lives in the database.
Setting sensitive = true on the Terraform variable block does not flag it as a secret in Amnify. Only the sensitive field in template.json does that. You can set both, but the JSON is the source of truth for UI masking and encryption.

Next Steps