forked from scm2342/rke2-build-hetzner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders.tf
60 lines (54 loc) · 1.8 KB
/
providers.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
terraform {
required_providers {
hcloud = {
source = "hetznercloud/hcloud"
version = "~> 1.49.1"
}
hetznerdns = {
source = "germanbrew/hetznerdns"
version = "~> 3.3.3"
}
kubectl = {
source = "gavinbunney/kubectl"
version = "~> 1.18.0"
}
remote = {
source = "tenstad/remote"
version = "~> 0.1.3"
}
}
}
provider "hcloud" {
token = var.hcloud_token
}
provider "hetznerdns" {
api_token = var.hdns_token
}
resource "terraform_data" "kubernetes" {
input = {
host = "https://${module.cluster.lb_ipv4}:6443"
cluster_ca_certificate = base64decode(module.cluster.cluster_ca_certificate)
client_certificate = base64decode(module.cluster.client_certificate)
client_key = base64decode(module.cluster.client_key)
}
}
provider "kubernetes" {
host = terraform_data.kubernetes.output.host
cluster_ca_certificate = terraform_data.kubernetes.output.cluster_ca_certificate
client_certificate = terraform_data.kubernetes.output.client_certificate
client_key = terraform_data.kubernetes.output.client_key
}
provider "kubectl" {
host = terraform_data.kubernetes.output.host
cluster_ca_certificate = terraform_data.kubernetes.output.cluster_ca_certificate
client_certificate = terraform_data.kubernetes.output.client_certificate
client_key = terraform_data.kubernetes.output.client_key
}
provider "helm" {
kubernetes {
host = terraform_data.kubernetes.output.host
cluster_ca_certificate = terraform_data.kubernetes.output.cluster_ca_certificate
client_certificate = terraform_data.kubernetes.output.client_certificate
client_key = terraform_data.kubernetes.output.client_key
}
}