Example: alibaba-shc
terraform/examples/alibaba-shc builds three ECS instances on a VPC with one
VSwitch and one security group, then bootstraps them when vault_pw is set.
No platform resources.
What differs
Section titled “What differs”modules/shc/alibabatakes aregion, an optionalzone_idand aninstance_typeper group. Withzone_idunset the module picks the first zone of the region that can hold a VSwitch.- The Alibaba provider reads
ALICLOUD_ACCESS_KEY,ALICLOUD_SECRET_KEYandALICLOUD_REGIONfrom the environment; the provider block is empty. bootstrap = var.vault_pw == "" ? null : { ... }gates the cluster on the password, as the Linode root does.
module "shc" { source = "../../modules/shc/alibaba"
cluster_name = var.cluster_name region = var.region zone_id = var.zone_id ssh_public_key = var.ssh_public_key node_groups = { control = { count = 3, instance_type = var.instance_type, runtime = "docker", control_plane = true } }}Running it
Section titled “Running it”ALICLOUD_ACCESS_KEY, ALICLOUD_SECRET_KEY, ALICLOUD_REGION,
TF_VAR_ssh_public_key and TF_VAR_vault_pw come from the environment.
tofu -chdir=learn/shc/terraform/examples/alibaba-shc inittofu -chdir=learn/shc/terraform/examples/alibaba-shc applytofu -chdir=learn/shc/terraform/examples/alibaba-shc destroyThis page was not walked: labs run on the learning project at Hetzner only, and the module has not been applied against a live account. Track F’s Alibaba page covers the same account through the CLI.
Next: Example: cloudstack-shc.
shc@docs:~$