Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions terraform/entra_apps.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ resource "azuread_service_principal" "caddy" {
}
}

# Entra ID gives client secrets a 2-year lifetime by default. Rotate the Caddy
# secret yearly so it is replaced well before it expires; otherwise Caddy's
# ACME DNS-01 challenge silently fails and the apt/yum TLS certificates lapse.
# After this clock trips, `terraform apply` creates a new secret and the Ansible
# playbook must be re-run to push it to the VM.
resource "time_rotating" "caddy_password" {
rotation_days = 365
}

resource "azuread_service_principal_password" "caddy" {
service_principal_id = azuread_service_principal.caddy.object_id

rotate_when_changed = {
rotation = time_rotating.caddy_password.id
}
}
5 changes: 5 additions & 0 deletions terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ terraform {
source = "hashicorp/google"
version = "~> 5.38.0"
}

time = {
source = "hashicorp/time"
version = "~> 0.12.1"
}
}

required_version = ">= 1.5"
Expand Down