Closed laukaichung closed 3 years ago
The way I understand, the provider configuration should implicitly flow to the child modules, so it should not be required to pass the Hetzner API token to the module. The reason it is there as a variable is because it is also needed to configure the Cloud Controller Manager after the cluster is bootstrapped.
https://www.terraform.io/docs/language/modules/develop/providers.html#implicit-provider-inheritance
Could it be a Terraform version thing? I tested this with 1.15. I also noticed that yours says source = "terraform-providers/hcloud"
not source = "hetznercloud/hcloud"
.
You could also try explicitly passing a provider to the module in to see if this helps. If it works I can update the examples with this.
module "k8s" {
source = "tibordp/dualstack-k8s/hcloud"
version = "0.5.0"
name = "k8s"
hcloud_token = var.hcloud_token
hcloud_ssh_key = hcloud_ssh_key.key.id
location = "hel1"
master_server_type = "cx31"
worker_server_type = "cx31"
worker_count = 2
providers = {
hcloud = hcloud
}
}
Thanks, I'll test it later. Apart from that, I'm able to install it without any issues.
You are right!
It should be hetznercloud/hcloud
, not terraform-providers/hcloud
.
I just installed the module but I can't get it to work. It says the argument token is required.
╷ │ Error: Missing required argument │ │ The argument "token" is required, but was not set. ╵
I have to add an hcloud provider block in
.terraform/modules/k8s/main.tf
to make the error go away.Here's my execution file.
input.tfvars