To use this module, call it as follows in your main.tf:
module "kommodity_azure_deployment" {
source = "github.com/kommodity-io/kommodity//terraform/modules/kommodity_azure_deployment?ref=<tag>"
providers = {
azurerm = azurerm # subscription hosting the deployment
azurerm.dns = azurerm.infrastructure # subscription hosting the public DNS zone
# if the DNS zone lives in the same subscription, use: azurerm.dns = azurerm
}
app_url = "https://kommodity.dev.example.com"
dns = {
zone = "example.com"
az_resource_group = "infrastructure-dns"
}
oidc_configuration = {
issuer_url = <issuer_url>
client_id = <client_id>
admin_group = <admin_group>
}
}This Terraform module provisions a complete Azure environment for the Kommodity service, including networking, database, logging, containerized application deployment, and a custom-domain HTTPS endpoint backed by an Azure-managed certificate.
It creates a dedicated resource group with a virtual network and separate subnets for the database and container app. A private DNS zone enables internal name resolution between resources.
The module deploys a PostgreSQL Flexible Server in a private subnet with a randomly generated admin password and no public access by default. It also provisions a Log Analytics Workspace for monitoring and diagnostics.
An Azure Container App is created to host the Kommodity application. Kommodity is configured with environment variables for authentication, logging, and runtime settings.
The module also manages the public DNS records (CNAME + asuid TXT) needed for app_url, binds the custom domain to the Container App, and issues an Azure Container App Environment Managed Certificate (validated via CNAME). The DNS records are protected by CanNotDelete management locks.
The azurerm.dns provider alias is required because the DNS zone typically lives in a different subscription than the deployment itself.
| Name | Version |
|---|---|
| azapi | ~> 2.9 |
| azurerm | ~>4.69.0 |
| random | ~> 3.9 |
| time | ~> 0.14 |
| Name | Version |
|---|---|
| azapi | 2.10.0 |
| azurerm | 4.69.0 |
| azurerm.dns | 4.69.0 |
| random | 3.9.0 |
No modules.
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| app_url | Custom domain URL for the Kommodity Container App (e.g. https://kommodity.dev.example.com). Must be a subdomain of var.dns.zone. | string |
n/a | yes |
| database | Database configuration | object({ |
{} |
no |
| database_password | Database password configuration | object({ |
{ |
no |
| dns | DNS configuration for the custom domain. zone = parent DNS zone name; az_resource_group = resource group hosting the zone. | object({ |
n/a | yes |
| kommodity_container | Kommodity container configuration | object({ |
{} |
no |
| log_analytics | Log Analytics workspace configuration | object({ |
{} |
no |
| oidc_configuration | OIDC configuration | object({ |
n/a | yes |
| resource_group | Resource group configuration | object({ |
{ |
no |
| virtual_network | Virtual network configuration | object({ |
{} |
no |
| Name | Description |
|---|---|
| app_url | The URL of the Kommodity Container App |
| container_app_environment_id | The ID of the Kommodity Container App Environment |
| container_app_id | The ID of the Kommodity Container App |
| custom_domain_verification_id | The Custom Domain Verification ID of the Kommodity Container App |