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.
What differs
Section titled “What differs”modules/shc/cloudstacktakes a site-definedzone, atemplate, anetwork_offeringand aservice_offeringper group. None has a default that can be right everywhere;cmk list zoneson your site names them.- The CloudStack provider reads
CLOUDSTACK_API_URL,CLOUDSTACK_API_KEYandCLOUDSTACK_SECRET_KEYfrom 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 }}Running it
Section titled “Running it”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.
tofu -chdir=learn/shc/terraform/examples/cloudstack-shc inittofu -chdir=learn/shc/terraform/examples/cloudstack-shc applytofu -chdir=learn/shc/terraform/examples/cloudstack-shc destroyThis 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.
shc@docs:~$