Atlantis Landing Zone

br/innofactor:avm/ptn/lz/atlantis:0.1.0

README

Atlantis Appliance (Landing Zone Pattern) [Lz/Atlantis]

A self-hosted Atlantis server for Terraform pull-request automation on Azure DevOps, delivered as an active/standby pair of VMs (or one VM) in its own spoke VNet behind Entra sign-in. Subscription-scope wrapper: it creates ONE resource group, then invokes the Atlantis workload layer (atlantis.bicep) inside it, which in turn consumes the payload-agnostic container-appliance pattern module.

  • container-appliance (avm/ptn/lz/container-appliance): VNet and subnet, NSG, NAT Gateway, VMs, data disk and failover lease, managed identity, Key Vault, backup, monitoring, alerting and patching.
  • atlantis.bicep: the Atlantis-specific layer: Terraform-state storage, the compose stack for Atlantis and oauth2-proxy, Atlantis’s own configuration, the depth probe and its alerts.

All parameters pass straight through. See the Notes section for the prerequisites checklist, the seed templates and the operational constraints.

Resource Types

Resource TypeAPI Version
Microsoft.Authorization/locks2020-05-01
Microsoft.Authorization/roleAssignments2022-04-01
Microsoft.Automanage/configurationProfileAssignments2022-05-04
Microsoft.Compute/disks2024-03-02
Microsoft.Compute/virtualMachines2024-07-01
Microsoft.Compute/virtualMachines/extensions2022-11-01
Microsoft.Compute/virtualMachineScaleSets2024-07-01
Microsoft.DevTestLab/schedules2018-09-15
Microsoft.GuestConfiguration/guestConfigurationAssignments2020-06-25
Microsoft.Insights/actionGroups2023-01-01
Microsoft.Insights/dataCollectionRuleAssociations2023-03-11
Microsoft.Insights/dataCollectionRuleAssociations2022-06-01
Microsoft.Insights/dataCollectionRules2023-03-11
Microsoft.Insights/diagnosticSettings2021-05-01-preview
Microsoft.Insights/metricAlerts2018-03-01
Microsoft.Insights/scheduledQueryRules2023-12-01
Microsoft.Insights/scheduledQueryRules2025-01-01-preview
Microsoft.Insights/workbooks2023-06-01
Microsoft.KeyVault/vaults2024-11-01
Microsoft.KeyVault/vaults/accessPolicies2024-11-01
Microsoft.KeyVault/vaults/keys2024-11-01
Microsoft.KeyVault/vaults/secrets2024-11-01
Microsoft.KeyVault/vaults/secrets2023-07-01
Microsoft.Maintenance/configurationAssignments2023-04-01
Microsoft.Maintenance/maintenanceConfigurations2023-04-01
Microsoft.ManagedIdentity/userAssignedIdentities2024-11-30
Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials2024-11-30
Microsoft.Network/loadBalancers2024-05-01
Microsoft.Network/natGateways2023-04-01
Microsoft.Network/networkInterfaces2024-05-01
Microsoft.Network/networkSecurityGroups2023-11-01
Microsoft.Network/privateEndpoints2023-11-01
Microsoft.Network/privateEndpoints2024-10-01
Microsoft.Network/privateEndpoints2024-05-01
Microsoft.Network/privateEndpoints/privateDnsZoneGroups2024-05-01
Microsoft.Network/privateEndpoints/privateDnsZoneGroups2023-11-01
Microsoft.Network/privateEndpoints/privateDnsZoneGroups2024-10-01
Microsoft.Network/publicIPAddresses2024-05-01
Microsoft.Network/publicIPAddresses2023-09-01
Microsoft.Network/publicIPPrefixes2023-09-01
Microsoft.Network/routeTables2024-05-01
Microsoft.Network/virtualNetworks2024-05-01
Microsoft.Network/virtualNetworks/subnets2024-05-01
Microsoft.Network/virtualNetworks/virtualNetworkPeerings2024-01-01
Microsoft.OperationalInsights/workspaces2025-02-01
Microsoft.OperationalInsights/workspaces/dataExports2025-02-01
Microsoft.OperationalInsights/workspaces/dataSources2025-02-01
Microsoft.OperationalInsights/workspaces/linkedServices2025-02-01
Microsoft.OperationalInsights/workspaces/linkedStorageAccounts2025-02-01
Microsoft.OperationalInsights/workspaces/savedSearches2025-02-01
Microsoft.OperationalInsights/workspaces/storageInsightConfigs2025-02-01
Microsoft.OperationalInsights/workspaces/tables2025-02-01
Microsoft.OperationsManagement/solutions2015-11-01-preview
Microsoft.RecoveryServices/vaults2024-04-01
Microsoft.RecoveryServices/vaults/backupconfig2023-01-01
Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems2023-01-01
Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems2024-10-01
Microsoft.RecoveryServices/vaults/backupPolicies2024-10-01
Microsoft.RecoveryServices/vaults/backupstorageconfig2023-01-01
Microsoft.RecoveryServices/vaults/replicationAlertSettings2022-10-01
Microsoft.RecoveryServices/vaults/replicationFabrics2022-10-01
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers2022-10-01
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings2022-10-01
Microsoft.RecoveryServices/vaults/replicationPolicies2023-06-01
Microsoft.Resources/resourceGroups2021-04-01
Microsoft.SecurityInsights/onboardingStates2024-03-01
Microsoft.Storage/storageAccounts2025-06-01
Microsoft.Storage/storageAccounts2023-05-01
Microsoft.Storage/storageAccounts/blobServices2025-01-01
Microsoft.Storage/storageAccounts/blobServices2022-09-01
Microsoft.Storage/storageAccounts/blobServices/containers2022-09-01
Microsoft.Storage/storageAccounts/blobServices/containers2025-01-01
Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies2022-09-01
Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies2025-01-01
Microsoft.Storage/storageAccounts/fileServices2023-04-01
Microsoft.Storage/storageAccounts/fileServices2025-06-01
Microsoft.Storage/storageAccounts/fileServices/shares2023-01-01
Microsoft.Storage/storageAccounts/fileServices/shares2025-01-01
Microsoft.Storage/storageAccounts/localUsers2025-06-01
Microsoft.Storage/storageAccounts/localUsers2023-04-01
Microsoft.Storage/storageAccounts/managementPolicies2025-06-01
Microsoft.Storage/storageAccounts/managementPolicies2023-01-01
Microsoft.Storage/storageAccounts/objectReplicationPolicies2025-01-01
Microsoft.Storage/storageAccounts/queueServices2025-06-01
Microsoft.Storage/storageAccounts/queueServices2023-04-01
Microsoft.Storage/storageAccounts/queueServices/queues2025-06-01
Microsoft.Storage/storageAccounts/queueServices/queues2023-04-01
Microsoft.Storage/storageAccounts/tableServices2025-06-01
Microsoft.Storage/storageAccounts/tableServices2023-04-01
Microsoft.Storage/storageAccounts/tableServices/tables2023-04-01
Microsoft.Storage/storageAccounts/tableServices/tables2025-06-01

Usage examples

The following section provides usage examples for the module, which were used to validate and deploy the module successfully. For a full reference, please review the module’s test folder in its repository.

Note: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.

Note: To reference the module, please use the following syntax br/innofactor:avm/ptn/lz/atlantis:<version>.

Example 1: Active/standby with a switchover

This instance deploys the Atlantis appliance as an active/standby pair and moves it. After the second deployment (the idempotency pass) a deployment script writes a marker to the data disk, lets the active host drain (it waits until Atlantis reports no operation in progress) and release the lease, detaches the disk and attaches it to the standby, and asserts that Atlantis answers on the load balancer again within five minutes with the marker intact. The duration is a deployment output.

via Bicep module
module atlantis 'br/innofactor:avm/ptn/lz/atlantis:<version>' = {
  name: 'atlantisDeployment'
  params: {
    // Required parameters
    adoUser: 'atlantis@example.com'
    adoWebhookUser: 'atlantis-webhook'
    atlantisExternalHostname: 'atllzasb.example.com'
    azureDevOpsPat: '<azureDevOpsPat>'
    azureDevOpsWebhookPassword: '<azureDevOpsWebhookPassword>'
    entraTenantId: '<entraTenantId>'
    inboundAllowedCidr: '10.0.0.0/8'
    oauth2ClientId: '00000000-0000-0000-0000-000000000000'
    oauth2ClientSecret: '<oauth2ClientSecret>'
    oauth2ProxyAllowedEmailDomains: 'example.com'
    oauth2ProxyCookieSecret: '<oauth2ProxyCookieSecret>'
    repoAllowlist: 'dev.azure.com/example-org/*'
    sshPublicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
    vnetAddressPrefix: '10.242.0.0/24'
    // Non-required parameters
    enableBackup: false
    enableKeyVaultPurgeProtection: false
    keyVaultName: '<keyVaultName>'
    location: '<location>'
    name: '<name>'
    registryToken: '<registryToken>'
    scaleMode: 'activeStandby'
  }
}

via JSON parameters file
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    // Required parameters
    "adoUser": {
      "value": "atlantis@example.com"
    },
    "adoWebhookUser": {
      "value": "atlantis-webhook"
    },
    "atlantisExternalHostname": {
      "value": "atllzasb.example.com"
    },
    "azureDevOpsPat": {
      "value": "<azureDevOpsPat>"
    },
    "azureDevOpsWebhookPassword": {
      "value": "<azureDevOpsWebhookPassword>"
    },
    "entraTenantId": {
      "value": "<entraTenantId>"
    },
    "inboundAllowedCidr": {
      "value": "10.0.0.0/8"
    },
    "oauth2ClientId": {
      "value": "00000000-0000-0000-0000-000000000000"
    },
    "oauth2ClientSecret": {
      "value": "<oauth2ClientSecret>"
    },
    "oauth2ProxyAllowedEmailDomains": {
      "value": "example.com"
    },
    "oauth2ProxyCookieSecret": {
      "value": "<oauth2ProxyCookieSecret>"
    },
    "repoAllowlist": {
      "value": "dev.azure.com/example-org/*"
    },
    "sshPublicKey": {
      "value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test"
    },
    "vnetAddressPrefix": {
      "value": "10.242.0.0/24"
    },
    // Non-required parameters
    "enableBackup": {
      "value": false
    },
    "enableKeyVaultPurgeProtection": {
      "value": false
    },
    "keyVaultName": {
      "value": "<keyVaultName>"
    },
    "location": {
      "value": "<location>"
    },
    "name": {
      "value": "<name>"
    },
    "registryToken": {
      "value": "<registryToken>"
    },
    "scaleMode": {
      "value": "activeStandby"
    }
  }
}

via Bicep parameters file
using 'br/innofactor:avm/ptn/lz/atlantis:<version>'

// Required parameters
param adoUser = 'atlantis@example.com'
param adoWebhookUser = 'atlantis-webhook'
param atlantisExternalHostname = 'atllzasb.example.com'
param azureDevOpsPat = '<azureDevOpsPat>'
param azureDevOpsWebhookPassword = '<azureDevOpsWebhookPassword>'
param entraTenantId = '<entraTenantId>'
param inboundAllowedCidr = '10.0.0.0/8'
oauth2ClientId: '00000000-0000-0000-0000-000000000000'
oauth2ClientSecret: '<oauth2ClientSecret>'
oauth2ProxyAllowedEmailDomains: 'example.com'
oauth2ProxyCookieSecret: '<oauth2ProxyCookieSecret>'
param repoAllowlist = 'dev.azure.com/example-org/*'
param sshPublicKey = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
param vnetAddressPrefix = '10.242.0.0/24'
// Non-required parameters
param enableBackup = false
param enableKeyVaultPurgeProtection = false
param keyVaultName = '<keyVaultName>'
param location = '<location>'
param name = '<name>'
param registryToken = '<registryToken>'
param scaleMode = 'activeStandby'

Example 2: Using only defaults

This instance deploys the Atlantis appliance with the minimum set of required parameters: an active/standby pair, images pulled from the private mirror with a Key Vault token, and no hub peering. The appliance creates its own managed identity, NAT Gateway and resource group.

via Bicep module
module atlantis 'br/innofactor:avm/ptn/lz/atlantis:<version>' = {
  name: 'atlantisDeployment'
  params: {
    // Required parameters
    adoUser: 'atlantis@example.com'
    adoWebhookUser: 'atlantis-webhook'
    atlantisExternalHostname: 'atllzmin.example.com'
    azureDevOpsPat: '<azureDevOpsPat>'
    azureDevOpsWebhookPassword: '<azureDevOpsWebhookPassword>'
    entraTenantId: '<entraTenantId>'
    inboundAllowedCidr: '10.0.0.0/8'
    oauth2ClientId: '00000000-0000-0000-0000-000000000000'
    oauth2ClientSecret: '<oauth2ClientSecret>'
    oauth2ProxyAllowedEmailDomains: 'example.com'
    oauth2ProxyCookieSecret: '<oauth2ProxyCookieSecret>'
    repoAllowlist: 'dev.azure.com/example-org/*'
    sshPublicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
    vnetAddressPrefix: '10.242.0.0/24'
    // Non-required parameters
    enableBackup: false
    enableKeyVaultPurgeProtection: false
    keyVaultName: '<keyVaultName>'
    location: '<location>'
    name: '<name>'
    registryToken: '<registryToken>'
  }
}

via JSON parameters file
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    // Required parameters
    "adoUser": {
      "value": "atlantis@example.com"
    },
    "adoWebhookUser": {
      "value": "atlantis-webhook"
    },
    "atlantisExternalHostname": {
      "value": "atllzmin.example.com"
    },
    "azureDevOpsPat": {
      "value": "<azureDevOpsPat>"
    },
    "azureDevOpsWebhookPassword": {
      "value": "<azureDevOpsWebhookPassword>"
    },
    "entraTenantId": {
      "value": "<entraTenantId>"
    },
    "inboundAllowedCidr": {
      "value": "10.0.0.0/8"
    },
    "oauth2ClientId": {
      "value": "00000000-0000-0000-0000-000000000000"
    },
    "oauth2ClientSecret": {
      "value": "<oauth2ClientSecret>"
    },
    "oauth2ProxyAllowedEmailDomains": {
      "value": "example.com"
    },
    "oauth2ProxyCookieSecret": {
      "value": "<oauth2ProxyCookieSecret>"
    },
    "repoAllowlist": {
      "value": "dev.azure.com/example-org/*"
    },
    "sshPublicKey": {
      "value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test"
    },
    "vnetAddressPrefix": {
      "value": "10.242.0.0/24"
    },
    // Non-required parameters
    "enableBackup": {
      "value": false
    },
    "enableKeyVaultPurgeProtection": {
      "value": false
    },
    "keyVaultName": {
      "value": "<keyVaultName>"
    },
    "location": {
      "value": "<location>"
    },
    "name": {
      "value": "<name>"
    },
    "registryToken": {
      "value": "<registryToken>"
    }
  }
}

via Bicep parameters file
using 'br/innofactor:avm/ptn/lz/atlantis:<version>'

// Required parameters
param adoUser = 'atlantis@example.com'
param adoWebhookUser = 'atlantis-webhook'
param atlantisExternalHostname = 'atllzmin.example.com'
param azureDevOpsPat = '<azureDevOpsPat>'
param azureDevOpsWebhookPassword = '<azureDevOpsWebhookPassword>'
param entraTenantId = '<entraTenantId>'
param inboundAllowedCidr = '10.0.0.0/8'
oauth2ClientId: '00000000-0000-0000-0000-000000000000'
oauth2ClientSecret: '<oauth2ClientSecret>'
oauth2ProxyAllowedEmailDomains: 'example.com'
oauth2ProxyCookieSecret: '<oauth2ProxyCookieSecret>'
param repoAllowlist = 'dev.azure.com/example-org/*'
param sshPublicKey = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
param vnetAddressPrefix = '10.242.0.0/24'
// Non-required parameters
param enableBackup = false
param enableKeyVaultPurgeProtection = false
param keyVaultName = '<keyVaultName>'
param location = '<location>'
param name = '<name>'
param registryToken = '<registryToken>'

Example 3: WAF-aligned

This instance deploys the Atlantis appliance in alignment with the best practices of the Azure Well-Architected Framework: backup, Key Vault purge protection, CanNotDelete locks on each stateful resource and deliberately NO resource-group lock (a resource-group lock stops Azure Resource Manager grooming deployment history and eventually fails every deployment), a pinned availability zone and an alert email receiver so the alerts reach someone.

via Bicep module
module atlantis 'br/innofactor:avm/ptn/lz/atlantis:<version>' = {
  name: 'atlantisDeployment'
  params: {
    // Required parameters
    adoUser: 'atlantis@example.com'
    adoWebhookUser: 'atlantis-webhook'
    atlantisExternalHostname: 'atllzwaf.example.com'
    azureDevOpsPat: '<azureDevOpsPat>'
    azureDevOpsWebhookPassword: '<azureDevOpsWebhookPassword>'
    entraTenantId: '<entraTenantId>'
    inboundAllowedCidr: '10.0.0.0/8'
    oauth2ClientId: '00000000-0000-0000-0000-000000000000'
    oauth2ClientSecret: '<oauth2ClientSecret>'
    oauth2ProxyAllowedEmailDomains: 'example.com'
    oauth2ProxyCookieSecret: '<oauth2ProxyCookieSecret>'
    repoAllowlist: 'dev.azure.com/example-org/*'
    sshPublicKey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
    vnetAddressPrefix: '10.242.0.0/24'
    // Non-required parameters
    alertEmailAddresses: [
      'platform-alerts@example.com'
    ]
    availabilityZone: 1
    dataDiskSizeGB: 128
    enableBackup: true
    enableKeyVaultPurgeProtection: true
    keyVaultName: '<keyVaultName>'
    location: '<location>'
    name: '<name>'
    protectStatefulResources: true
    registryToken: '<registryToken>'
    tags: {
      Environment: 'Test'
      Workload: 'atlantis'
    }
  }
}

via JSON parameters file
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    // Required parameters
    "adoUser": {
      "value": "atlantis@example.com"
    },
    "adoWebhookUser": {
      "value": "atlantis-webhook"
    },
    "atlantisExternalHostname": {
      "value": "atllzwaf.example.com"
    },
    "azureDevOpsPat": {
      "value": "<azureDevOpsPat>"
    },
    "azureDevOpsWebhookPassword": {
      "value": "<azureDevOpsWebhookPassword>"
    },
    "entraTenantId": {
      "value": "<entraTenantId>"
    },
    "inboundAllowedCidr": {
      "value": "10.0.0.0/8"
    },
    "oauth2ClientId": {
      "value": "00000000-0000-0000-0000-000000000000"
    },
    "oauth2ClientSecret": {
      "value": "<oauth2ClientSecret>"
    },
    "oauth2ProxyAllowedEmailDomains": {
      "value": "example.com"
    },
    "oauth2ProxyCookieSecret": {
      "value": "<oauth2ProxyCookieSecret>"
    },
    "repoAllowlist": {
      "value": "dev.azure.com/example-org/*"
    },
    "sshPublicKey": {
      "value": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test"
    },
    "vnetAddressPrefix": {
      "value": "10.242.0.0/24"
    },
    // Non-required parameters
    "alertEmailAddresses": {
      "value": [
        "platform-alerts@example.com"
      ]
    },
    "availabilityZone": {
      "value": 1
    },
    "dataDiskSizeGB": {
      "value": 128
    },
    "enableBackup": {
      "value": true
    },
    "enableKeyVaultPurgeProtection": {
      "value": true
    },
    "keyVaultName": {
      "value": "<keyVaultName>"
    },
    "location": {
      "value": "<location>"
    },
    "name": {
      "value": "<name>"
    },
    "protectStatefulResources": {
      "value": true
    },
    "registryToken": {
      "value": "<registryToken>"
    },
    "tags": {
      "value": {
        "Environment": "Test",
        "Workload": "atlantis"
      }
    }
  }
}

via Bicep parameters file
using 'br/innofactor:avm/ptn/lz/atlantis:<version>'

// Required parameters
param adoUser = 'atlantis@example.com'
param adoWebhookUser = 'atlantis-webhook'
param atlantisExternalHostname = 'atllzwaf.example.com'
param azureDevOpsPat = '<azureDevOpsPat>'
param azureDevOpsWebhookPassword = '<azureDevOpsWebhookPassword>'
param entraTenantId = '<entraTenantId>'
param inboundAllowedCidr = '10.0.0.0/8'
oauth2ClientId: '00000000-0000-0000-0000-000000000000'
oauth2ClientSecret: '<oauth2ClientSecret>'
oauth2ProxyAllowedEmailDomains: 'example.com'
oauth2ProxyCookieSecret: '<oauth2ProxyCookieSecret>'
param repoAllowlist = 'dev.azure.com/example-org/*'
param sshPublicKey = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM9TTqqoeYf+/iC1UenThlG3LrKakoeCeDQS3veHJqXe avs-e2e-test'
param vnetAddressPrefix = '10.242.0.0/24'
// Non-required parameters
param alertEmailAddresses = [
  'platform-alerts@example.com'
]
param availabilityZone = 1
param dataDiskSizeGB = 128
param enableBackup = true
param enableKeyVaultPurgeProtection = true
param keyVaultName = '<keyVaultName>'
param location = '<location>'
param name = '<name>'
param protectStatefulResources = true
param registryToken = '<registryToken>'
param tags = {
  Environment: 'Test'
  Workload: 'atlantis'
}

Parameters

Required parameters

ParameterTypeDescription
adoUserstringAzure DevOps username Atlantis authenticates to the API as.
adoWebhookUserstringBasic-auth username for inbound Azure DevOps webhook calls.
atlantisExternalHostnamestringPublic hostname the appliance is reached at.
azureDevOpsPatsecurestringAzure DevOps Personal Access Token.
azureDevOpsWebhookPasswordsecurestringAzure DevOps inbound webhook basic-auth password.
entraTenantIdstringEntra tenant ID used as the OIDC issuer for oauth2-proxy.
inboundAllowedCidrstringCIDR allowed inbound to the appliance on oauth2ProxyPort: the publishing gateway’s subnet.
oauth2ClientIdstringEntra App Registration client ID for oauth2-proxy — PREREQUISITE, not created by this template.
oauth2ClientSecretsecurestringEntra App Registration client secret for oauth2-proxy.
oauth2ProxyAllowedEmailDomainsstringComma-separated list of email domains oauth2-proxy allows through.
oauth2ProxyCookieSecretsecurestringoauth2-proxy session cookie encryption secret.
repoAllowliststringRepository allowlist pattern for Atlantis.
sshPublicKeystringSSH public key for the admin account.
vnetAddressPrefixstringAddress space for the appliance’s own VNet. See the container-appliance module for the full description.

Conditional parameters

ParameterTypeDescription
existingIdentityPrincipalIdstringRequired if createNewManagedIdentity is false. Principal ID of the existing identity.
existingIdentityResourceIdstringRequired if createNewManagedIdentity is false. Resource ID of the existing identity to attach.
registryTokensecurestringRequired if containerRegistry.mode is keyVaultToken. A read-only registry token (read:packages) for the registry that serves the images, issued to a service identity, never to a person. Stored in the appliance Key Vault as the secret named by containerRegistry.tokenSecretName.

Optional parameters

ParameterTypeDescription
activeInstanceintactiveStandby only: which host (1 or 2) the data disk is attached to when the template is deployed. After a switchover, redeploy with the number of the host that now holds the disk.
adminUsernamestringLocal admin username on the appliance VM.
alertEmailAddressesarrayEmail addresses for the appliance action group (see the container-appliance module).
applianceSubnetNewBitsintPrefix length of the appliance subnet, carved as the first subnet of vnetAddressPrefix with cidrSubnet() (27 = a /27). Despite the name, this is a prefix length, not a count of new bits.
armSubscriptionIdstringSubscription ID exported to Terraform as ARM_SUBSCRIPTION_ID. Empty omits it.
atlantisImagestringThe Atlantis image, as <registry>/<repository>:<tag>@sha256:<digest>. Always pinned by digest, so what runs is exactly what was mirrored and reviewed. The default is the private mirror of runatlantis/atlantis v0.48.0 (platform.mirror-images.yml).
availabilityZoneintAvailability zone for the appliance. See the container-appliance module.
containerRegistryobjectHow the hosts pull the Atlantis and oauth2-proxy images. The default pulls the private mirror at ghcr.io/innofactororg/mirror with a read-only token held in the appliance Key Vault (mode keyVaultToken, secret registry-token, filled from registryToken). Use mode anonymous when the image parameters name a public registry.
createNatGatewayboolCreate and associate a NAT Gateway for outbound egress — see the container-appliance module for why this cannot default to false without an alternative egress path.
createNewManagedIdentityboolCreate a new user-assigned identity (true, the product default) or attach an existing one (false).
dataDiskSizeGBintSize in GB of the dedicated Atlantis data disk.
defaultRouteNextHopIpAddressstringNext-hop IP for a 0.0.0.0/0 route on the appliance subnet. See the container-appliance module.
dnsServersarrayCustom DNS servers for the appliance VNet.
enableBackupboolBack up the VMs with Azure Backup. Default true; keep it on for anything real. See the container-appliance module for why tests turn it off.
enableKeyVaultPurgeProtectionboolPurge protection on the appliance Key Vault. Default true.
enablePatchScheduleboolAttach the VM to the patch window. False leaves patching to Azure, at times Azure chooses.
enablePolicyChecksboolStart Atlantis with –enable-policy-checks. See atlantis.bicep.
enableTelemetryboolEnable/Disable usage telemetry for module.
hostPrivateIpAddressstringStatic private IP for the appliance VM, inside the appliance’s own subnet. See the container-appliance module for the default.
itsmWebhookUristringITSM webhook URI for the action group.
keyVaultNamestringName of the appliance Key Vault. Empty derives it from the name. See the container-appliance module.
locationstringAzure region to deploy the resources.
lockobjectA lock to apply to the whole resource group. NOT recommended: it stops Azure Resource Manager grooming deployment history and eventually fails every deployment. Use protectStatefulResources instead.
maintenanceWindowobjectMonthly in-guest patch window (Azure Update Manager maintenance configuration). See the container-appliance module for the default and why the schedule is dedicated.
namestringPrefix for resource names, and the name of the single resource group created.
oauth2ProxyImagestringThe oauth2-proxy image, as <registry>/<repository>:<tag>@sha256:<digest>. The default is the private mirror of oauth2-proxy v7.15.5.
oauth2ProxyOidcEmailClaimstringThe ID-token claim oauth2-proxy treats as the user’s email. See atlantis.bicep.
oauth2ProxyPortintPort oauth2-proxy listens on.
protectStatefulResourcesboolCanNotDelete locks on each resource that holds state, instead of on the resource group. See the container-appliance module for why a resource-group lock is the wrong tool.
repoConfigstringContent of the Atlantis server-side repo config (repos.yaml). See atlantis.bicep — a deployment replacing an existing Atlantis server MUST carry that server’s repo config.
roleAssignmentsarrayAdditional role assignments to grant on the resource group.
scaleModestringactiveStandby (default): two hosts in one zone, one data disk attached to the active host, a blob lease so only that host runs Atlantis, and an internal load balancer that sends traffic to the host that serves. single: one VM. Atlantis keeps its state (BoltDB, plan cache, lock table) on the data disk and runs one operation at a time against it, so loadBalanced is not offered. See ADR 14.
tagsobjectTags applied to every resource.
terraformLinuxAmd64Sha256stringSHA-256 of terraform_<terraformVersion>_linux_amd64.zip, from https://releases.hashicorp.com/terraform/<version>/terraform_<version>_SHA256SUMS. Must match terraformVersion: the bootstrap fails, and so does the deployment, when the download does not match.
terraformVersionstringDefault Terraform version Atlantis pins per plan.
virtualNetworkPeeringsarrayVNet peerings in the AVM shape. A remote side is a write outside the appliance resource group.
vmSizestringVM size. MUST NOT be a burstable (B-series) SKU — see atlantis.bicep.
workspaceResourceIdstringResource ID of an existing Log Analytics Workspace.
Parameter: adoUser

Azure DevOps username Atlantis authenticates to the API as.

  • Required: Yes
  • Type: string
Parameter: adoWebhookUser

Basic-auth username for inbound Azure DevOps webhook calls.

  • Required: Yes
  • Type: string
Parameter: atlantisExternalHostname

Public hostname the appliance is reached at.

  • Required: Yes
  • Type: string
Parameter: azureDevOpsPat

Azure DevOps Personal Access Token.

  • Required: Yes
  • Type: securestring
Parameter: azureDevOpsWebhookPassword

Azure DevOps inbound webhook basic-auth password.

  • Required: Yes
  • Type: securestring
Parameter: entraTenantId

Entra tenant ID used as the OIDC issuer for oauth2-proxy.

  • Required: Yes
  • Type: string
Parameter: inboundAllowedCidr

CIDR allowed inbound to the appliance on oauth2ProxyPort: the publishing gateway’s subnet.

  • Required: Yes
  • Type: string
Parameter: oauth2ClientId

Entra App Registration client ID for oauth2-proxy — PREREQUISITE, not created by this template.

  • Required: Yes
  • Type: string
Parameter: oauth2ClientSecret

Entra App Registration client secret for oauth2-proxy.

  • Required: Yes
  • Type: securestring
Parameter: oauth2ProxyAllowedEmailDomains

Comma-separated list of email domains oauth2-proxy allows through.

  • Required: Yes
  • Type: string
Parameter: oauth2ProxyCookieSecret

oauth2-proxy session cookie encryption secret.

  • Required: Yes
  • Type: securestring
Parameter: repoAllowlist

Repository allowlist pattern for Atlantis.

  • Required: Yes
  • Type: string
Parameter: sshPublicKey

SSH public key for the admin account.

  • Required: Yes
  • Type: string
Parameter: vnetAddressPrefix

Address space for the appliance’s own VNet. See the container-appliance module for the full description.

  • Required: Yes
  • Type: string
Parameter: existingIdentityPrincipalId

Required if createNewManagedIdentity is false. Principal ID of the existing identity.

  • Required: No
  • Type: string
  • Default: ''
Parameter: existingIdentityResourceId

Required if createNewManagedIdentity is false. Resource ID of the existing identity to attach.

  • Required: No
  • Type: string
  • Default: ''
Parameter: registryToken

Required if containerRegistry.mode is keyVaultToken. A read-only registry token (read:packages) for the registry that serves the images, issued to a service identity, never to a person. Stored in the appliance Key Vault as the secret named by containerRegistry.tokenSecretName.

  • Required: No
  • Type: securestring
  • Default: ''
Parameter: activeInstance

activeStandby only: which host (1 or 2) the data disk is attached to when the template is deployed. After a switchover, redeploy with the number of the host that now holds the disk.

  • Required: No
  • Type: int
  • Default: 1
  • Allowed:
    [
      1
      2
    ]
Parameter: adminUsername

Local admin username on the appliance VM.

  • Required: No
  • Type: string
  • Default: 'atlantisadmin'
Parameter: alertEmailAddresses

Email addresses for the appliance action group (see the container-appliance module).

  • Required: No
  • Type: array
  • Default: []
Parameter: applianceSubnetNewBits

Prefix length of the appliance subnet, carved as the first subnet of vnetAddressPrefix with cidrSubnet() (27 = a /27). Despite the name, this is a prefix length, not a count of new bits.

  • Required: No
  • Type: int
  • Default: 27
Parameter: armSubscriptionId

Subscription ID exported to Terraform as ARM_SUBSCRIPTION_ID. Empty omits it.

  • Required: No
  • Type: string
  • Default: ''
Parameter: atlantisImage

The Atlantis image, as <registry>/<repository>:<tag>@sha256:<digest>. Always pinned by digest, so what runs is exactly what was mirrored and reviewed. The default is the private mirror of runatlantis/atlantis v0.48.0 (platform.mirror-images.yml).

  • Required: No
  • Type: string
  • Default: 'ghcr.io/innofactororg/mirror/atlantis:v0.48.0@sha256:8dd77ed01565f797fe62922f4670398b16a094597b36dedd6e806490177fffd9'
Parameter: availabilityZone

Availability zone for the appliance. See the container-appliance module.

  • Required: No
  • Type: int
  • Default: 1
  • Allowed:
    [
      1
      2
      3
    ]
Parameter: containerRegistry

How the hosts pull the Atlantis and oauth2-proxy images. The default pulls the private mirror at ghcr.io/innofactororg/mirror with a read-only token held in the appliance Key Vault (mode keyVaultToken, secret registry-token, filled from registryToken). Use mode anonymous when the image parameters name a public registry.

  • Required: No
  • Type: object
  • Default:
    {
        mode: 'keyVaultToken'
        server: 'ghcr.io'
        tokenSecretName: 'registry-token'
    }

Required parameters

ParameterTypeDescription
modestringHow to authenticate: anonymous, managedIdentity or keyVaultToken.
serverstringRegistry server name, for example contoso.azurecr.io. Empty with mode anonymous.

Conditional parameters

ParameterTypeDescription
tokenSecretNamestringRequired if mode is keyVaultToken: name of the Key Vault secret (one of keyVaultSecrets) holding the registry token.

Optional parameters

ParameterTypeDescription
registryResourceIdstringmanagedIdentity only: resource ID of the Azure Container Registry, to grant the VM identity AcrPull on it.
tokenUsernamestringkeyVaultToken only: the user name that goes with the token.
Parameter: containerRegistry.mode

How to authenticate: anonymous, managedIdentity or keyVaultToken.

  • Required: Yes
  • Type: string
  • Allowed:
    [
      'anonymous'
      'keyVaultToken'
      'managedIdentity'
    ]
Parameter: containerRegistry.server

Registry server name, for example contoso.azurecr.io. Empty with mode anonymous.

  • Required: Yes
  • Type: string
Parameter: containerRegistry.tokenSecretName

Required if mode is keyVaultToken: name of the Key Vault secret (one of keyVaultSecrets) holding the registry token.

  • Required: No
  • Type: string
Parameter: containerRegistry.registryResourceId

managedIdentity only: resource ID of the Azure Container Registry, to grant the VM identity AcrPull on it.

  • Required: No
  • Type: string
Parameter: containerRegistry.tokenUsername

keyVaultToken only: the user name that goes with the token.

  • Required: No
  • Type: string
Parameter: createNatGateway

Create and associate a NAT Gateway for outbound egress — see the container-appliance module for why this cannot default to false without an alternative egress path.

  • Required: No
  • Type: bool
  • Default: True
Parameter: createNewManagedIdentity

Create a new user-assigned identity (true, the product default) or attach an existing one (false).

  • Required: No
  • Type: bool
  • Default: True
Parameter: dataDiskSizeGB

Size in GB of the dedicated Atlantis data disk.

  • Required: No
  • Type: int
  • Default: 128
Parameter: defaultRouteNextHopIpAddress

Next-hop IP for a 0.0.0.0/0 route on the appliance subnet. See the container-appliance module.

  • Required: No
  • Type: string
  • Default: ''
Parameter: dnsServers

Custom DNS servers for the appliance VNet.

  • Required: No
  • Type: array
  • Default: []
Parameter: enableBackup

Back up the VMs with Azure Backup. Default true; keep it on for anything real. See the container-appliance module for why tests turn it off.

  • Required: No
  • Type: bool
  • Default: True
Parameter: enableKeyVaultPurgeProtection

Purge protection on the appliance Key Vault. Default true.

  • Required: No
  • Type: bool
  • Default: True
Parameter: enablePatchSchedule

Attach the VM to the patch window. False leaves patching to Azure, at times Azure chooses.

  • Required: No
  • Type: bool
  • Default: True
Parameter: enablePolicyChecks

Start Atlantis with –enable-policy-checks. See atlantis.bicep.

  • Required: No
  • Type: bool
  • Default: False
Parameter: enableTelemetry

Enable/Disable usage telemetry for module.

  • Required: No
  • Type: bool
  • Default: True
Parameter: hostPrivateIpAddress

Static private IP for the appliance VM, inside the appliance’s own subnet. See the container-appliance module for the default.

  • Required: No
  • Type: string
  • Default: ''
Parameter: itsmWebhookUri

ITSM webhook URI for the action group.

  • Required: No
  • Type: string
  • Default: ''
Parameter: keyVaultName

Name of the appliance Key Vault. Empty derives it from the name. See the container-appliance module.

  • Required: No
  • Type: string
  • Default: ''
Parameter: location

Azure region to deploy the resources.

  • Required: No
  • Type: string
  • Default: 'westeurope'
Parameter: lock

A lock to apply to the whole resource group. NOT recommended: it stops Azure Resource Manager grooming deployment history and eventually fails every deployment. Use protectStatefulResources instead.

  • Required: No
  • Type: object

Optional parameters

ParameterTypeDescription
kindstringThe lock kind.
namestringName of the lock.
notesstringNotes about this lock.
Parameter: lock.kind

The lock kind.

  • Required: No
  • Type: string
  • Allowed:
    [
      'CanNotDelete'
      'None'
      'ReadOnly'
    ]
Parameter: lock.name

Name of the lock.

  • Required: No
  • Type: string
Parameter: lock.notes

Notes about this lock.

  • Required: No
  • Type: string
Parameter: maintenanceWindow

Monthly in-guest patch window (Azure Update Manager maintenance configuration). See the container-appliance module for the default and why the schedule is dedicated.

  • Required: No
  • Type: object
Parameter: name

Prefix for resource names, and the name of the single resource group created.

  • Required: No
  • Type: string
  • Default: 'atlantis'
Parameter: oauth2ProxyImage

The oauth2-proxy image, as <registry>/<repository>:<tag>@sha256:<digest>. The default is the private mirror of oauth2-proxy v7.15.5.

  • Required: No
  • Type: string
  • Default: 'ghcr.io/innofactororg/mirror/oauth2-proxy:v7.15.5@sha256:8498b0d0ef0a7b29686414000a08aee467f02d0299c9ed1e006a8f33fc017916'
Parameter: oauth2ProxyOidcEmailClaim

The ID-token claim oauth2-proxy treats as the user’s email. See atlantis.bicep.

  • Required: No
  • Type: string
  • Default: 'email'
Parameter: oauth2ProxyPort

Port oauth2-proxy listens on.

  • Required: No
  • Type: int
  • Default: 4141
Parameter: protectStatefulResources

CanNotDelete locks on each resource that holds state, instead of on the resource group. See the container-appliance module for why a resource-group lock is the wrong tool.

  • Required: No
  • Type: bool
  • Default: True
Parameter: repoConfig

Content of the Atlantis server-side repo config (repos.yaml). See atlantis.bicep — a deployment replacing an existing Atlantis server MUST carry that server’s repo config.

  • Required: No
  • Type: string
  • Default: ''
Parameter: roleAssignments

Additional role assignments to grant on the resource group.

  • Required: No
  • Type: array

Required parameters

ParameterTypeDescription
principalIdstringThe principal ID of the user, group, or service principal to assign the role to.
roleDefinitionIdOrNamestringThe role to assign — either a full role definition resource ID, or a bare role definition GUID (resolved against this subscription).

Optional parameters

ParameterTypeDescription
principalTypestringThe principal type of the assigned principal ID.
Parameter: roleAssignments.principalId

The principal ID of the user, group, or service principal to assign the role to.

  • Required: Yes
  • Type: string
Parameter: roleAssignments.roleDefinitionIdOrName

The role to assign — either a full role definition resource ID, or a bare role definition GUID (resolved against this subscription).

  • Required: Yes
  • Type: string
Parameter: roleAssignments.principalType

The principal type of the assigned principal ID.

  • Required: No
  • Type: string
  • Allowed:
    [
      'Device'
      'ForeignGroup'
      'Group'
      'ServicePrincipal'
      'User'
    ]
Parameter: scaleMode

activeStandby (default): two hosts in one zone, one data disk attached to the active host, a blob lease so only that host runs Atlantis, and an internal load balancer that sends traffic to the host that serves. single: one VM. Atlantis keeps its state (BoltDB, plan cache, lock table) on the data disk and runs one operation at a time against it, so loadBalanced is not offered. See ADR 14.

  • Required: No
  • Type: string
  • Default: 'activeStandby'
  • Allowed:
    [
      'activeStandby'
      'single'
    ]
Parameter: tags

Tags applied to every resource.

  • Required: No
  • Type: object
Parameter: terraformLinuxAmd64Sha256

SHA-256 of terraform_<terraformVersion>_linux_amd64.zip, from https://releases.hashicorp.com/terraform/<version>/terraform_<version>_SHA256SUMS. Must match terraformVersion: the bootstrap fails, and so does the deployment, when the download does not match.

  • Required: No
  • Type: string
  • Default: 'dc94af0eef1147718ad7c8daea792ed199e3e0492eec180d0adafa2a65a879df'
Parameter: terraformVersion

Default Terraform version Atlantis pins per plan.

  • Required: No
  • Type: string
  • Default: '1.16.4'
Parameter: virtualNetworkPeerings

VNet peerings in the AVM shape. A remote side is a write outside the appliance resource group.

  • Required: No
  • Type: array
  • Default: []
Parameter: vmSize

VM size. MUST NOT be a burstable (B-series) SKU — see atlantis.bicep.

  • Required: No
  • Type: string
  • Default: 'Standard_D2as_v5'
Parameter: workspaceResourceId

Resource ID of an existing Log Analytics Workspace.

  • Required: No
  • Type: string
  • Default: ''

Outputs

OutputTypeDescription
applianceAddressstringAddress clients reach the appliance on: the internal load balancer frontend in activeStandby, the host private IP in single.
applianceHostNamesarrayNames of the appliance hosts.
applianceHostResourceIdsarrayResource IDs of the appliance hosts.
applianceSubnetResourceIdstringResource ID of the appliance subnet.
applianceVmPrivateIpAddressstringStatic private IP of the appliance VM: the publishing gateway’s backend target.
applianceVmResourceIdstringResource ID of the appliance VM.
dataDiskNamestringName of the data disk that holds the Atlantis state.
keyVaultNamestringName of the appliance’s own Key Vault.
keyVaultUristringURI of the appliance’s own Key Vault.
manualStepsRequiredForReusearrayRole assignments the template could not make because the identity was reused. Empty for a new identity.
tfStateContainerNamestringBlob container holding Terraform state.
tfStateStorageAccountNamestringStorage account holding Terraform state (RBAC only, no shared keys).
virtualNetworkResourceIdstringResource ID of the appliance VNet, for peerings.
vmIdentityPrincipalIdstringPrincipal ID of the identity Terraform runs as. Grant it the roles each target landing zone needs.

Cross-referenced modules

This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).

ReferenceType
br/innofactor:avm/ptn/lz/container-appliance:0.1.0Remote reference
br/public:avm/res/resources/resource-group:0.4.1Remote reference
br/public:avm/res/storage/storage-account:0.14.3Remote reference

Notes

What it deploys

A subscription-scope deployment that creates one resource group and everything inside it, in three layers:

LayerScopeContents
main.bicepSubscriptionCreates the resource group and invokes atlantis.bicep. It writes nothing outside the resource group: the hub return route is a prerequisite (see below).
atlantis.bicepResource groupEverything specific to Atlantis: the Terraform state storage account (resource-level lock, RBAC only, no shared keys), the Docker Compose stack for Atlantis and oauth2-proxy, Atlantis’s server configuration, the one-minute depth probe and its two alerts.
br/innofactor:avm/ptn/lz/container-appliance:0.1.0Resource groupThe payload-agnostic infrastructure, published as its own pattern module: VNet and subnet, NSG, optional NAT Gateway, Ubuntu VM with a separate data disk, user-assigned identity (new or reused), the Key Vault the VM reads its four secrets from, Recovery Services backup, Log Analytics and data collection rule, action group, CPU and heartbeat alerts, a health workbook and a dedicated patch window. It contains no reference to Atlantis.

This module therefore depends on a published version of container-appliance. Its behaviour, the payload contract it exposes and its own operational constraints (locks, identity reuse, data disk, patching, backup) are documented in that module’s README; the parameters below that pass straight through (vnetAddressPrefix, createNatGateway, maintenanceWindow, protectStatefulResources and so on) are described there in full.

Traffic shape: Azure DevOps service hooks post to /events, which bypasses oauth2-proxy and is protected by the webhook basic-auth credential alone. Everything else (/, the lock UI) goes through oauth2-proxy and Entra sign-in. /healthz is unauthenticated so an upstream health probe does not see a login redirect. The images come from the Innofactor private mirror (ghcr.io/innofactororg/mirror), pinned by digest, and are pulled with a read-only registry token held in the appliance Key Vault (containerRegistry mode keyVaultToken, token in registryToken); the agent logs in only while it pulls. Point atlantisImage, oauth2ProxyImage and containerRegistry at your own mirror to use another registry.

The method (onboarding, cutover, operations runbooks and the design rationale) lives in the Innofactor practice repository under ip-library/atlantis/. This module is the deployable half; read the method before the first deployment.

Active/standby, images and the Terraform binary
  • Scale mode. scaleMode is activeStandby (default: two hosts in one zone, one data disk, a blob lease and an internal load balancer) or single. The data disk is the disk that is moved; activeInstance says which host it is attached to at deployment time.
  • Seeding the data disk. The agent mounts the data disk after the bootstrap commands run, so the bootstrap writes the seed (repos.yaml, .gitconfig, the pinned Terraform binary) under the compose directory, and the one-shot atlantis-init service copies it into the data disk and fixes ownership every time the stack starts.
  • Pinned toolchain. Terraform terraformVersion is downloaded once on each host, checked against terraformLinuxAmd64Sha256 and given to Atlantis as its default version. A checksum mismatch fails the deployment. Atlantis does not download Terraform itself unless a repository asks for another version.
  • Drain. Before a switchover, scale-in or shutdown the agent runs a drain command that polls Atlantis /status and waits (up to about four and a half minutes) until no operation is in progress.
  • Logs. The containers log to journald, which the appliance’s data collection rule ships to Log Analytics.
Seed templates

The templates in seed/ are deployed once, by hand, before the first deployment, because a pipeline cannot create what it runs under.

FileCreates
seed/seed-vault.bicepA separate Key Vault (own resource group, own lifecycle) holding the four deployment secrets, read at deploy time with getSecret() so no pipeline ever handles a secret.
seed/pipeline-identity.bicepA user-assigned managed identity with a workload-identity-federation credential for the Azure DevOps service connection: Owner on the subscription, plus Managed Identity Operator on a reused appliance identity when one is used. Two passes (see the file header).
Prerequisites

None of these are created by the template. Work through them in order; items 1–3 must be in
place before the VM is created, because the bootstrap installs Docker and pulls the images
during VM provisioning and fails the deployment if it has no egress.

  1. Subscription and address range registered. A subscription for the appliance, and a spoke
    VNet address range (vnetAddressPrefix, a /24 is ample; the appliance subnet is carved with
    applianceSubnetNewBits) registered in the estate’s IPAM so it cannot collide with another
    spoke.

  2. Hub firewall egress allow-list (only when egress goes through a hub firewall,
    createNatGateway = false + defaultRouteNextHopIpAddress). A missing entry shows as a deny
    in the firewall log, not as an Atlantis error. At minimum:

    • Azure DevOps: dev.azure.com, vssps.dev.azure.com, vsaex.dev.azure.com (the latter two
      are used by the identity and entitlement APIs behind the PAT scopes below)
    • Terraform: registry.terraform.io, releases.hashicorp.com, github.com,
      objects.githubusercontent.com (providers and modules hosted on GitHub)
    • Container registries: ghcr.io, pkg-containers.githubusercontent.com (Atlantis),
      quay.io and its CDN (oauth2-proxy)
    • Docker packages: download.docker.com
    • Ubuntu packages and patching: the Azure Ubuntu archive mirror, esm.ubuntu.com,
      livepatch.canonical.com
    • Azure control and data plane: login.microsoftonline.com, management.azure.com,
      *.vault.azure.net, *.blob.core.windows.net (Terraform state), and the Azure Monitor
      agent endpoints (global.handler.control.monitor.azure.com, *.ods.opinsights.azure.com,
      *.ingest.monitor.azure.com)

    With the NAT Gateway (the default), none of this is needed. Beware the reverse trap: if the VNet
    is later peered to a hub that advertises 0.0.0.0/0, that route overrides the NAT Gateway
    and silently redirects egress through the hub firewall.

  3. Publishing gateway listener and DNS. A public listener for atlantisExternalHostname on the
    estate’s publishing gateway (for example an Application Gateway with WAF) whose backend is
    applianceAddress:oauth2ProxyPort (the internal load balancer in activeStandby, the host in single), the DNS record for that hostname, and a DNS route from
    the appliance VNet to the estate’s domain controllers or resolvers through the hub (dnsServers
    plus a peering) if Terraform must resolve private endpoints. When traffic arrives over the hub, the hub needs a return route for this
    appliance’s address space: this module does not write it. Add it with the hubReturnRoutes parameter of
    workload-networking 0.4.11.

  4. Entra app registration for oauth2-proxy. Web platform, redirect URI
    https://<atlantisExternalHostname>/oauth2/callback, a client secret. Supply the client ID as
    oauth2ClientId; the secret goes into the seed vault.

  5. Seed Key Vault with the four secrets. Deploy seed/seed-vault.bicep, then write:

    Secret nameParameterContent
    atlantis-ado-patazureDevOpsPatThe service account’s PAT (item 6)
    atlantis-webhook-passwordazureDevOpsWebhookPasswordRandom, letters and digits only (a $ is read by Docker Compose as a variable); the service hooks present it with adoWebhookUser
    oauth2-proxy-client-secretoauth2ClientSecretThe app registration’s secret (item 4)
    oauth2-proxy-cookie-secretoauth2ProxyCookieSecretopenssl rand -base64 32 | tr -- '+/' '-_' (URL-safe: oauth2-proxy rejects a standard base64 value containing + or /)

    Secrets are changed in the seed vault and then redeployed, never edited in the appliance’s
    own vault, which the next deployment overwrites.

  6. Azure DevOps service account and PAT. A dedicated, non-personal account (adoUser) with a
    PAT carrying exactly these scopes: vso.code_write, vso.code_status, vso.threads_full,
    vso.build_execute, vso.project, vso.memberentitlementmanagement. Give the account View
    and Edit subscriptions in the Service Hooks permission namespace of each project it serves
    (see “Service hooks” below). Put its repositories in repoAllowlist.

  7. Managed identity and grants per target landing zone. The VM identity (new, or reused via
    existingIdentityResourceId) is what Terraform runs as. Grant it, on every landing zone
    Atlantis will apply to, the roles those Terraform roots need, and nothing broader. A reused
    identity also needs the roles listed in the manualStepsRequiredForReuse output (Key Vault
    Secrets User on the appliance vault, Storage Blob Data Contributor on the state account), and
    whoever deploys needs Managed Identity Operator on it. Treat the grant set as a
    privilege-escalation review: whoever can merge to an onboarded repository acts with these rights.

  8. Policy exemption for resource-group delete-lock enforcers. Do not lock the resource
    group (leave lock unset). A CanNotDelete lock on the group stops Azure Resource Manager
    grooming deployment history, and once the group reaches the 800-record ceiling every deployment
    into it fails. If the estate stamps resource-group delete locks by policy, add a policy
    exemption (category Mitigated) for this resource group after the first deployment and delete the
    stamped lock. The stateful resources (VM, OS and data disks, Key Vault, Log Analytics workspace when created, Recovery Services vault, Terraform state storage) carry
    their own resource-level locks through protectStatefulResources (default true).

  9. An action group receiver. Set alertEmailAddresses and/or itsmWebhookUri. The alerts are
    always created, but an action group with no receiver delivers nothing.

Consuming the module from a wrapper
targetScope = 'subscription'

resource seedVault 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
  name: '<seed vault name>'
  scope: resourceGroup('atlantis-secrets')
}

module atlantis 'br/innofactor:avm/ptn/lz/atlantis:0.1.0' = {
  name: 'atlantis-appliance'
  params: {
    name: 'atlantis'
    location: 'westeurope'
    vnetAddressPrefix: '10.242.0.0/24'
    inboundAllowedCidr: '<publishing gateway subnet CIDR>'
    sshPublicKey: '<ssh-ed25519 public key>'
    atlantisExternalHostname: 'atlantis.example.com'
    repoAllowlist: 'dev.azure.com/<organisation>/*'
    adoUser: 'atlantis@example.com'
    adoWebhookUser: 'atlantis'
    entraTenantId: tenant().tenantId
    oauth2ClientId: '<app registration client ID>'
    oauth2ProxyAllowedEmailDomains: 'example.com'
    azureDevOpsPat: seedVault.getSecret('atlantis-ado-pat')
    azureDevOpsWebhookPassword: seedVault.getSecret('atlantis-webhook-password')
    oauth2ClientSecret: seedVault.getSecret('oauth2-proxy-client-secret')
    oauth2ProxyCookieSecret: seedVault.getSecret('oauth2-proxy-cookie-secret')
    alertEmailAddresses: [
      'platform-alerts@example.com'
    ]
    // Hub-and-spoke egress instead of the NAT Gateway (prerequisite 2 must be in place first):
    // createNatGateway: false
    // defaultRouteNextHopIpAddress: '<hub firewall private IP>'
    // dnsServers: [ '<DNS server IP>' ]
  }
}

The same values work as a .bicepparam file with az.getSecret('<sub>', '<rg>', '<vault>', '<secret>').
The tests in tests/e2e/ (defaults, waf-aligned, active-standby) show the minimum and the recommended
parameter sets; their examples are listed under Usage examples above.

Deploying from an Azure DevOps pipeline

The pipeline handles no secrets. It signs in through the workload-identity-federation service
connection created for seed/pipeline-identity.bicep, validates, shows a what-if, and deploys
behind an environment approval.

trigger:
  branches:
    include: [main]

pool:
  vmImage: ubuntu-latest

variables:
  serviceConnection: '<service connection name>'
  location: westeurope

stages:
  - stage: Plan
    jobs:
      - job: whatif
        steps:
          - task: AzureCLI@2
            displayName: Validate and what-if
            inputs:
              azureSubscription: $(serviceConnection)
              scriptType: bash
              scriptLocation: inlineScript
              inlineScript: |
                az deployment sub validate --location $(location) \
                  --template-file main.bicep --parameters main.bicepparam
                az deployment sub what-if --location $(location) \
                  --template-file main.bicep --parameters main.bicepparam                

  - stage: Deploy
    dependsOn: Plan
    condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
    jobs:
      - deployment: deploy
        environment: atlantis   # add an approval check on this environment
        strategy:
          runOnce:
            deploy:
              steps:
                - checkout: self
                - task: AzureCLI@2
                  displayName: Deploy
                  inputs:
                    azureSubscription: $(serviceConnection)
                    scriptType: bash
                    scriptLocation: inlineScript
                    inlineScript: |
                      az deployment sub create --name atlantis-appliance --location $(location) \
                        --template-file main.bicep --parameters main.bicepparam                      

Before the deploy step, check the what-if for any change under dataDisks (see the first
operational constraint) and, if one is present, schedule the run as an outage.

Operational constraints
  1. A data-disk property change on a running VM is an outage. Azure applies any change under
    dataDisks (caching, size, SKU) by hot-detaching and re-attaching the disk. The guest kernel
    takes the device offline and the ext4 filesystem holding Atlantis’s lock database, clones and
    plan cache does not survive it, while the web UI and /healthz keep answering. Schedule the
    change, restart the VM straight afterwards, and check the mount. The disk is mounted by UUID
    with nofail, so it remounts cleanly on restart.

  2. Service hooks run as their last modifier. Azure DevOps evaluates a service hook as the
    identity that last saved it. If that person loses access (for example, is offboarded), every
    event is recorded as filtered in the hook’s delivery history and never sent, and nothing in
    Atlantis shows an error. Create and save every hook as the Atlantis service account, never
    as a person, and check hook ownership before anyone with project-admin rights leaves. A read of
    an existing hook returns the password masked, so any save must supply it again.

  3. Four service hooks per repository, all posting to https://<atlantisExternalHostname>/events
    with the full message and the webhook credential:

    EventFilterPurpose
    Pull request created—Autoplan
    Pull request updated“Source branch updated” (PushNotification)Autoplan on every push
    Pull request updated“Status changed” (StatusUpdateNotification)On merge or abandon, release the PR’s locks and plans
    Pull request commented on—atlantis plan / atlantis apply comment commands

    Do not subscribe votes or reviewer changes, and do not collapse the two “updated” hooks into one
    unfiltered hook: every approval vote would trigger an autoplan that collides with Atlantis’s
    one-command-per-PR lock. Without the status hook, merged PRs keep their locks and block later
    PRs on the same projects. Then add the repository to repoAllowlist and give it an
    atlantis.yaml.

  4. Probe alert threshold. The depth probe runs every minute and checks /healthz, the Azure
    DevOps API, the Terraform binary, the lock database, both containers and free disk space. The
    probe alert fires when the last 10 minutes hold two or more failed runs, or fewer than five
    runs at all
    (a silent probe means the VM, the timer or log collection is down). A single failed
    minute does not fire. A second alert fires below 15% free on the OS or data disk. The web UI and
    /healthz can be green while Atlantis is broken, so read the probe before any cutover, apply
    window or sign-off.

  5. Never -out a tfplan outside Atlantis, and never commit one. A saved plan file contains
    every variable and resource attribute in clear text, secrets included. Atlantis manages its own
    plan files on the data disk; run ad-hoc plans without -out.

  6. One instance per state, moved on purpose. Atlantis’s locking is in-process and its BoltDB takes an
    exclusive file lock, so it cannot run active-active. In activeStandby the second host is a cold
    standby: only the host that holds the blob lease runs Atlantis, and the data disk is attached to that
    host alone. A switchover is a control-plane operation (the agent never moves disks): release the lease
    on the active host (appliance-agent.sh release, which first runs the drain hook and waits for Atlantis
    to report no operation in progress), detach the disk, attach it to the other host, then redeploy with
    activeInstance set to the host that now holds the disk. See ADR 0014.

  7. A server replacing an existing Atlantis must carry that server’s repo config in
    repoConfig; without it, approved stops being an apply requirement.

  8. repoAllowlist must be one organisation-wide pattern of the form dev.azure.com/<organisation>/*.
    The depth probe derives its Azure DevOps API URL from it by stripping /*, so a
    comma-separated list or a per-project pattern produces a probe URL that always fails, and the
    probe alert fires permanently.

Files
  • main.bicep / main.json: subscription-scope entry point and its compiled form
  • atlantis.bicep: the Atlantis workload layer (resource-group scope)
  • seed/: the seed vault and pipeline identity, deployed once by hand
  • tests/e2e/defaults, tests/e2e/waf-aligned, tests/e2e/active-standby: end-to-end tests (the last one also performs a switchover)

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Changelog

Changelog

0.1.0

Changes
  • First release of the module. A self-hosted Atlantis server for Terraform pull-request automation on Azure DevOps, delivered on the container-appliance pattern module (0.1.0). See the README for parameters and examples.
  • Runs as an active/standby pair by default (scaleMode), with single for one host. The data disk is the disk that moves on a switchover; the drain hook waits for Atlantis to finish running operations.
  • Images are the digest-pinned Innofactor private mirror (atlantisImage, oauth2ProxyImage), pulled with a read-only token from the appliance Key Vault (containerRegistry mode keyVaultToken, registryToken).
  • Terraform is pinned by version and SHA-256 (terraformVersion, terraformLinuxAmd64Sha256).
  • The module does not write hub routes. The return route is a prerequisite, set with workload-networking hubReturnRoutes (0.4.11).
Breaking Changes
  • None

Version history

VersionPublished
0.1.02026-11-14