Example: scaleway-shc
terraform/examples/scaleway-shc builds one node in the group the root names compose and three workers
on a Scaleway private network. Scaleway has no load balancer provider in SHC
and its DNS hosts only apex zones, so DNS goes through Cloudflare and there is
no lb topology.
What differs
Section titled “What differs”- The provider block takes the access key, secret key and project id from
variables;
regionandzoneare both set, because the private network is regional and the instances are zonal. assign_flexible_ips = truegives every node a public address of its own.root_volume.type = "sbs_volume"picks block storage for the root disk.dns_credentialsis a Cloudflare token or, withdns_provider = "scaleway"on an apex zone, the Scaleway secret key assecret_key.
provider "scaleway" { access_key = var.scaleway_access_key secret_key = var.scaleway_secret_key project_id = var.scaleway_project_id region = var.region zone = var.zone}
module "shc" { node_groups = { compose = { count = 1, type = var.instance_type, runtime = "docker" } workers = { count = 3, type = var.instance_type, runtime = "docker" } } assign_flexible_ips = true root_volume = { size = var.root_volume_gb, type = "sbs_volume" }}Running it
Section titled “Running it”TF_VAR_scaleway_access_key, TF_VAR_scaleway_secret_key,
TF_VAR_scaleway_project_id and TF_VAR_dns_token come from the environment;
dns_zone, shc_host and demo_app_host on the command line.
tofu -chdir=learn/shc/terraform/examples/scaleway-shc inittofu -chdir=learn/shc/terraform/examples/scaleway-shc apply -var dns_zone=example.com -var shc_host=cloud.example.com -var demo_app_host=whoami.example.comtofu -chdir=learn/shc/terraform/examples/scaleway-shc destroy -var dns_zone=example.com -var shc_host=cloud.example.com -var demo_app_host=whoami.example.comThis page was not walked: labs run on the learning project at Hetzner only. Track F’s Scaleway page covers the same account through the CLI.
Next: Example: vultr-shc.
shc@docs:~$