Example: azure-shc
terraform/examples/azure-shc builds three nodes in one Azure resource
group and wires the platform with root-level resources: a DNS connection,
one config document, the public catalogue, and Gitea integrated with
Postgres.
What differs
Section titled “What differs”modules/shc/azuretakesadmin_username, asizeper group and aroot_volumewith an Azure disk type.create_ssh_key = trueas in the ladder, andssh = { user = var.admin_username }.- The DNS connection’s credentials are either a Cloudflare token or the same
service principal Terraform runs as, picked by
dns_provider. shc_deployment "gitea"is public, has a route, andintegrate = { postgres = { stack = shc_deployment.postgres.stack } }binds it to the Postgres deployment the way-i postgres=dbdoes on the CLI.
resource "shc_deployment" "gitea" { tenant = shc_tenant.apps.name repo = shc_repo.shc.name app = "gitea" stack = "gitea" public = true routes = { "git.${var.dns_zone}" = { service = "gitea", port = 3000 } } wait_healthy = true integrate = { postgres = { stack = shc_deployment.postgres.stack } } depends_on = [shc_deployment.postgres, shc_config.platform]}Running it
Section titled “Running it”ARM_SUBSCRIPTION_ID, ARM_TENANT_ID, ARM_CLIENT_ID and ARM_CLIENT_SECRET
for a service principal, TF_VAR_dns_token, TF_VAR_vault_password and
TF_VAR_dns_zone come from the environment.
tofu -chdir=learn/shc/terraform/examples/azure-shc inittofu -chdir=learn/shc/terraform/examples/azure-shc applytofu -chdir=learn/shc/terraform/examples/azure-shc destroyThis page was not walked: no Azure credential is on the learning workstation. Track F’s Azure page covers the same account through the CLI.
Next: Example: gcp-shc.
shc@docs:~$