Skip to content
SHC Docs

Example: cloudstack-shc

terraform/examples/cloudstack-shc builds three instances on one isolated network of an Apache CloudStack zone, each reachable through a public IP with static NAT. The cluster forms when vault_pw is set.

  • modules/shc/cloudstack takes a site-defined zone, a template, a network_offering and a service_offering per group. None has a default that can be right everywhere; cmk list zones on your site names them.
  • The CloudStack provider reads CLOUDSTACK_API_URL, CLOUDSTACK_API_KEY and CLOUDSTACK_SECRET_KEY from the environment.
  • root_volume = { size = 100 } sizes the root disk.
module "shc" {
source = "../../modules/shc/cloudstack"
cluster_name = var.cluster_name
zone = var.zone
template = var.template
network_offering = var.network_offering
ssh_public_key = var.ssh_public_key
node_groups = {
control = { count = 3, service_offering = var.service_offering, runtime = "docker", control_plane = true }
}
root_volume = { size = 100 }
}

CLOUDSTACK_API_URL, CLOUDSTACK_API_KEY, CLOUDSTACK_SECRET_KEY, TF_VAR_ssh_public_key and TF_VAR_vault_pw come from the environment; the zone and offerings in a tfvars.

Terminal window
tofu -chdir=learn/shc/terraform/examples/cloudstack-shc init
tofu -chdir=learn/shc/terraform/examples/cloudstack-shc apply
tofu -chdir=learn/shc/terraform/examples/cloudstack-shc destroy

This page was not walked: there is no CloudStack site to run it on, and the module has not been applied against a live account.

Next: Example: openstack-shc.