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.
Navigation
Resource Types
| Resource Type | API Version |
|---|---|
Microsoft.Authorization/locks | 2020-05-01 |
Microsoft.Authorization/roleAssignments | 2022-04-01 |
Microsoft.Automanage/configurationProfileAssignments | 2022-05-04 |
Microsoft.Compute/disks | 2024-03-02 |
Microsoft.Compute/virtualMachines | 2024-07-01 |
Microsoft.Compute/virtualMachines/extensions | 2022-11-01 |
Microsoft.Compute/virtualMachineScaleSets | 2024-07-01 |
Microsoft.DevTestLab/schedules | 2018-09-15 |
Microsoft.GuestConfiguration/guestConfigurationAssignments | 2020-06-25 |
Microsoft.Insights/actionGroups | 2023-01-01 |
Microsoft.Insights/dataCollectionRuleAssociations | 2023-03-11 |
Microsoft.Insights/dataCollectionRuleAssociations | 2022-06-01 |
Microsoft.Insights/dataCollectionRules | 2023-03-11 |
Microsoft.Insights/diagnosticSettings | 2021-05-01-preview |
Microsoft.Insights/metricAlerts | 2018-03-01 |
Microsoft.Insights/scheduledQueryRules | 2023-12-01 |
Microsoft.Insights/scheduledQueryRules | 2025-01-01-preview |
Microsoft.Insights/workbooks | 2023-06-01 |
Microsoft.KeyVault/vaults | 2024-11-01 |
Microsoft.KeyVault/vaults/accessPolicies | 2024-11-01 |
Microsoft.KeyVault/vaults/keys | 2024-11-01 |
Microsoft.KeyVault/vaults/secrets | 2024-11-01 |
Microsoft.KeyVault/vaults/secrets | 2023-07-01 |
Microsoft.Maintenance/configurationAssignments | 2023-04-01 |
Microsoft.Maintenance/maintenanceConfigurations | 2023-04-01 |
Microsoft.ManagedIdentity/userAssignedIdentities | 2024-11-30 |
Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials | 2024-11-30 |
Microsoft.Network/loadBalancers | 2024-05-01 |
Microsoft.Network/natGateways | 2023-04-01 |
Microsoft.Network/networkInterfaces | 2024-05-01 |
Microsoft.Network/networkSecurityGroups | 2023-11-01 |
Microsoft.Network/privateEndpoints | 2023-11-01 |
Microsoft.Network/privateEndpoints | 2024-10-01 |
Microsoft.Network/privateEndpoints | 2024-05-01 |
Microsoft.Network/privateEndpoints/privateDnsZoneGroups | 2024-05-01 |
Microsoft.Network/privateEndpoints/privateDnsZoneGroups | 2023-11-01 |
Microsoft.Network/privateEndpoints/privateDnsZoneGroups | 2024-10-01 |
Microsoft.Network/publicIPAddresses | 2024-05-01 |
Microsoft.Network/publicIPAddresses | 2023-09-01 |
Microsoft.Network/publicIPPrefixes | 2023-09-01 |
Microsoft.Network/routeTables | 2024-05-01 |
Microsoft.Network/virtualNetworks | 2024-05-01 |
Microsoft.Network/virtualNetworks/subnets | 2024-05-01 |
Microsoft.Network/virtualNetworks/virtualNetworkPeerings | 2024-01-01 |
Microsoft.OperationalInsights/workspaces | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/dataExports | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/dataSources | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/linkedServices | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/linkedStorageAccounts | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/savedSearches | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/storageInsightConfigs | 2025-02-01 |
Microsoft.OperationalInsights/workspaces/tables | 2025-02-01 |
Microsoft.OperationsManagement/solutions | 2015-11-01-preview |
Microsoft.RecoveryServices/vaults | 2024-04-01 |
Microsoft.RecoveryServices/vaults/backupconfig | 2023-01-01 |
Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems | 2023-01-01 |
Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems | 2024-10-01 |
Microsoft.RecoveryServices/vaults/backupPolicies | 2024-10-01 |
Microsoft.RecoveryServices/vaults/backupstorageconfig | 2023-01-01 |
Microsoft.RecoveryServices/vaults/replicationAlertSettings | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationFabrics | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings | 2022-10-01 |
Microsoft.RecoveryServices/vaults/replicationPolicies | 2023-06-01 |
Microsoft.Resources/resourceGroups | 2021-04-01 |
Microsoft.SecurityInsights/onboardingStates | 2024-03-01 |
Microsoft.Storage/storageAccounts | 2025-06-01 |
Microsoft.Storage/storageAccounts | 2023-05-01 |
Microsoft.Storage/storageAccounts/blobServices | 2025-01-01 |
Microsoft.Storage/storageAccounts/blobServices | 2022-09-01 |
Microsoft.Storage/storageAccounts/blobServices/containers | 2022-09-01 |
Microsoft.Storage/storageAccounts/blobServices/containers | 2025-01-01 |
Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies | 2022-09-01 |
Microsoft.Storage/storageAccounts/blobServices/containers/immutabilityPolicies | 2025-01-01 |
Microsoft.Storage/storageAccounts/fileServices | 2023-04-01 |
Microsoft.Storage/storageAccounts/fileServices | 2025-06-01 |
Microsoft.Storage/storageAccounts/fileServices/shares | 2023-01-01 |
Microsoft.Storage/storageAccounts/fileServices/shares | 2025-01-01 |
Microsoft.Storage/storageAccounts/localUsers | 2025-06-01 |
Microsoft.Storage/storageAccounts/localUsers | 2023-04-01 |
Microsoft.Storage/storageAccounts/managementPolicies | 2025-06-01 |
Microsoft.Storage/storageAccounts/managementPolicies | 2023-01-01 |
Microsoft.Storage/storageAccounts/objectReplicationPolicies | 2025-01-01 |
Microsoft.Storage/storageAccounts/queueServices | 2025-06-01 |
Microsoft.Storage/storageAccounts/queueServices | 2023-04-01 |
Microsoft.Storage/storageAccounts/queueServices/queues | 2025-06-01 |
Microsoft.Storage/storageAccounts/queueServices/queues | 2023-04-01 |
Microsoft.Storage/storageAccounts/tableServices | 2025-06-01 |
Microsoft.Storage/storageAccounts/tableServices | 2023-04-01 |
Microsoft.Storage/storageAccounts/tableServices/tables | 2023-04-01 |
Microsoft.Storage/storageAccounts/tableServices/tables | 2025-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
| Parameter | Type | Description |
|---|---|---|
adoUser | string | Azure DevOps username Atlantis authenticates to the API as. |
adoWebhookUser | string | Basic-auth username for inbound Azure DevOps webhook calls. |
atlantisExternalHostname | string | Public hostname the appliance is reached at. |
azureDevOpsPat | securestring | Azure DevOps Personal Access Token. |
azureDevOpsWebhookPassword | securestring | Azure DevOps inbound webhook basic-auth password. |
entraTenantId | string | Entra tenant ID used as the OIDC issuer for oauth2-proxy. |
inboundAllowedCidr | string | CIDR allowed inbound to the appliance on oauth2ProxyPort: the publishing gateway’s subnet. |
oauth2ClientId | string | Entra App Registration client ID for oauth2-proxy — PREREQUISITE, not created by this template. |
oauth2ClientSecret | securestring | Entra App Registration client secret for oauth2-proxy. |
oauth2ProxyAllowedEmailDomains | string | Comma-separated list of email domains oauth2-proxy allows through. |
oauth2ProxyCookieSecret | securestring | oauth2-proxy session cookie encryption secret. |
repoAllowlist | string | Repository allowlist pattern for Atlantis. |
sshPublicKey | string | SSH public key for the admin account. |
vnetAddressPrefix | string | Address space for the appliance’s own VNet. See the container-appliance module for the full description. |
Conditional parameters
| Parameter | Type | Description |
|---|---|---|
existingIdentityPrincipalId | string | Required if createNewManagedIdentity is false. Principal ID of the existing identity. |
existingIdentityResourceId | string | Required if createNewManagedIdentity is false. Resource ID of the existing identity to attach. |
registryToken | securestring | 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. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
activeInstance | int | 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. |
adminUsername | string | Local admin username on the appliance VM. |
alertEmailAddresses | array | Email addresses for the appliance action group (see the container-appliance module). |
applianceSubnetNewBits | int | 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. |
armSubscriptionId | string | Subscription ID exported to Terraform as ARM_SUBSCRIPTION_ID. Empty omits it. |
atlantisImage | string | 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). |
availabilityZone | int | Availability zone for the appliance. See the container-appliance module. |
containerRegistry | object | 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. |
createNatGateway | bool | 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. |
createNewManagedIdentity | bool | Create a new user-assigned identity (true, the product default) or attach an existing one (false). |
dataDiskSizeGB | int | Size in GB of the dedicated Atlantis data disk. |
defaultRouteNextHopIpAddress | string | Next-hop IP for a 0.0.0.0/0 route on the appliance subnet. See the container-appliance module. |
dnsServers | array | Custom DNS servers for the appliance VNet. |
enableBackup | bool | 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. |
enableKeyVaultPurgeProtection | bool | Purge protection on the appliance Key Vault. Default true. |
enablePatchSchedule | bool | Attach the VM to the patch window. False leaves patching to Azure, at times Azure chooses. |
enablePolicyChecks | bool | Start Atlantis with –enable-policy-checks. See atlantis.bicep. |
enableTelemetry | bool | Enable/Disable usage telemetry for module. |
hostPrivateIpAddress | string | Static private IP for the appliance VM, inside the appliance’s own subnet. See the container-appliance module for the default. |
itsmWebhookUri | string | ITSM webhook URI for the action group. |
keyVaultName | string | Name of the appliance Key Vault. Empty derives it from the name. See the container-appliance module. |
location | string | Azure region to deploy the resources. |
lock | object | 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. |
maintenanceWindow | object | Monthly in-guest patch window (Azure Update Manager maintenance configuration). See the container-appliance module for the default and why the schedule is dedicated. |
name | string | Prefix for resource names, and the name of the single resource group created. |
oauth2ProxyImage | string | The oauth2-proxy image, as <registry>/<repository>:<tag>@sha256:<digest>. The default is the private mirror of oauth2-proxy v7.15.5. |
oauth2ProxyOidcEmailClaim | string | The ID-token claim oauth2-proxy treats as the user’s email. See atlantis.bicep. |
oauth2ProxyPort | int | Port oauth2-proxy listens on. |
protectStatefulResources | bool | 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. |
repoConfig | string | 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. |
roleAssignments | array | Additional role assignments to grant on the resource group. |
scaleMode | string | 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. |
tags | object | Tags applied to every resource. |
terraformLinuxAmd64Sha256 | string | 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. |
terraformVersion | string | Default Terraform version Atlantis pins per plan. |
virtualNetworkPeerings | array | VNet peerings in the AVM shape. A remote side is a write outside the appliance resource group. |
vmSize | string | VM size. MUST NOT be a burstable (B-series) SKU — see atlantis.bicep. |
workspaceResourceId | string | Resource 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
| Parameter | Type | Description |
|---|---|---|
mode | string | How to authenticate: anonymous, managedIdentity or keyVaultToken. |
server | string | Registry server name, for example contoso.azurecr.io. Empty with mode anonymous. |
Conditional parameters
| Parameter | Type | Description |
|---|---|---|
tokenSecretName | string | Required if mode is keyVaultToken: name of the Key Vault secret (one of keyVaultSecrets) holding the registry token. |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
registryResourceId | string | managedIdentity only: resource ID of the Azure Container Registry, to grant the VM identity AcrPull on it. |
tokenUsername | string | keyVaultToken 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
| Parameter | Type | Description |
|---|---|---|
kind | string | The lock kind. |
name | string | Name of the lock. |
notes | string | Notes 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
| Parameter | Type | Description |
|---|---|---|
principalId | string | The principal ID of the user, group, or service principal to assign the role to. |
roleDefinitionIdOrName | string | The role to assign — either a full role definition resource ID, or a bare role definition GUID (resolved against this subscription). |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
principalType | string | The 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
| Output | Type | Description |
|---|---|---|
applianceAddress | string | Address clients reach the appliance on: the internal load balancer frontend in activeStandby, the host private IP in single. |
applianceHostNames | array | Names of the appliance hosts. |
applianceHostResourceIds | array | Resource IDs of the appliance hosts. |
applianceSubnetResourceId | string | Resource ID of the appliance subnet. |
applianceVmPrivateIpAddress | string | Static private IP of the appliance VM: the publishing gateway’s backend target. |
applianceVmResourceId | string | Resource ID of the appliance VM. |
dataDiskName | string | Name of the data disk that holds the Atlantis state. |
keyVaultName | string | Name of the appliance’s own Key Vault. |
keyVaultUri | string | URI of the appliance’s own Key Vault. |
manualStepsRequiredForReuse | array | Role assignments the template could not make because the identity was reused. Empty for a new identity. |
tfStateContainerName | string | Blob container holding Terraform state. |
tfStateStorageAccountName | string | Storage account holding Terraform state (RBAC only, no shared keys). |
virtualNetworkResourceId | string | Resource ID of the appliance VNet, for peerings. |
vmIdentityPrincipalId | string | Principal 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).
| Reference | Type |
|---|---|
br/innofactor:avm/ptn/lz/container-appliance:0.1.0 | Remote reference |
br/public:avm/res/resources/resource-group:0.4.1 | Remote reference |
br/public:avm/res/storage/storage-account:0.14.3 | Remote reference |
Notes
What it deploys
A subscription-scope deployment that creates one resource group and everything inside it, in three layers:
| Layer | Scope | Contents |
|---|---|---|
main.bicep | Subscription | Creates the resource group and invokes atlantis.bicep. It writes nothing outside the resource group: the hub return route is a prerequisite (see below). |
atlantis.bicep | Resource group | Everything 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.0 | Resource group | The 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.
scaleModeisactiveStandby(default: two hosts in one zone, one data disk, a blob lease and an internal load balancer) orsingle. The data disk is the disk that is moved;activeInstancesays 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-shotatlantis-initservice copies it into the data disk and fixes ownership every time the stack starts. - Pinned toolchain. Terraform
terraformVersionis downloaded once on each host, checked againstterraformLinuxAmd64Sha256and 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
/statusand 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.
| File | Creates |
|---|---|
seed/seed-vault.bicep | A 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.bicep | A 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.
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 withapplianceSubnetNewBits) registered in the estate’s IPAM so it cannot collide with another
spoke.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.ioand 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 advertises0.0.0.0/0, that route overrides the NAT Gateway
and silently redirects egress through the hub firewall.- Azure DevOps:
Publishing gateway listener and DNS. A public listener for
atlantisExternalHostnameon the
estate’s publishing gateway (for example an Application Gateway with WAF) whose backend isapplianceAddress:oauth2ProxyPort(the internal load balancer inactiveStandby, the host insingle), 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 thehubReturnRoutesparameter of
workload-networking 0.4.11.Entra app registration for oauth2-proxy. Web platform, redirect URI
https://<atlantisExternalHostname>/oauth2/callback, a client secret. Supply the client ID asoauth2ClientId; the secret goes into the seed vault.Seed Key Vault with the four secrets. Deploy
seed/seed-vault.bicep, then write:Secret name Parameter Content 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 withadoWebhookUseroauth2-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.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 inrepoAllowlist.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 themanualStepsRequiredForReuseoutput (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.Policy exemption for resource-group delete-lock enforcers. Do not lock the resource
group (leavelockunset). ACanNotDeletelock 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 throughprotectStatefulResources(defaulttrue).An action group receiver. Set
alertEmailAddressesand/oritsmWebhookUri. 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
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/healthzkeep answering. Schedule the
change, restart the VM straight afterwards, and check the mount. The disk is mounted by UUID
withnofail, so it remounts cleanly on restart.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 asfilteredin 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.Four service hooks per repository, all posting to
https://<atlantisExternalHostname>/events
with the full message and the webhook credential:Event Filter Purpose 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 applycomment commandsDo 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 torepoAllowlistand give it anatlantis.yaml.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/healthzcan be green while Atlantis is broken, so read the probe before any cutover, apply
window or sign-off.Never
-outa 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.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. InactiveStandbythe 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 withactiveInstanceset to the host that now holds the disk. See ADR 0014.A server replacing an existing Atlantis must carry that server’s repo config in
repoConfig; without it,approvedstops being an apply requirement.repoAllowlistmust be one organisation-wide pattern of the formdev.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 formatlantis.bicep: the Atlantis workload layer (resource-group scope)seed/: the seed vault and pipeline identity, deployed once by handtests/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-appliancepattern module (0.1.0). See the README for parameters and examples. - Runs as an active/standby pair by default (
scaleMode), withsinglefor 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 (containerRegistrymodekeyVaultToken,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
| Version | Published |
|---|---|
0.1.0 | 2026-11-14 |