Example: vultr-shc
terraform/examples/vultr-shc mirrors a live Vultr estate: one node in the group the root names compose
and three workers, a vultr connection that serves the load balancer and
block volumes, and Cloudflare for DNS because Vultr DNS cannot host a
subdomain zone.
What differs
Section titled “What differs”modules/shc/vultrtakes aplanper group and anos_name.- Two connections:
vultrwith the API key and region for proxy and volumes, anddnswith the Cloudflare token for the zone. shc_config.platformsetsstorage.volumes.provider: vultrbeside the DNS and ACME keys.- The public route on
whoamiis written asroutes = { "whoami.${var.dns_zone}" = {} }: an empty route takes the app’s one exposed port.
resource "shc_connection" "vultr" { name = "vultr" type = "vultr" credentials = { api_key = var.vultr_api_key region = module.shc.region } depends_on = [module.shc]}
resource "shc_deployment" "whoami" { tenant = shc_tenant.apps.name repo = "shc" app = "whoami" stack = "whoami" public = true routes = { "whoami.${var.dns_zone}" = {} } wait_healthy = true depends_on = [shc_repo.shc]}Running it
Section titled “Running it”VULTR_API_KEY, TF_VAR_vultr_api_key and TF_VAR_dns_token come from the
environment; dns_zone, cluster_name and acme_email on the command line.
tofu -chdir=learn/shc/terraform/examples/vultr-shc inittofu -chdir=learn/shc/terraform/examples/vultr-shc apply -var dns_zone=example.com -var cluster_name=shc-vultr -var [email protected]tofu -chdir=learn/shc/terraform/examples/vultr-shc destroy -var dns_zone=example.com -var cluster_name=shc-vultr -var [email protected]This page was not walked: no Vultr credential is on the learning workstation. Track F’s Vultr page covers the same account through the CLI.
Next: Example: exoscale-shc.
shc@docs:~$