-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprovider.tf
50 lines (42 loc) · 1.65 KB
/
provider.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
terraform {
required_providers {
# User to provision resources (firewal / cluster) in civo.com
civo = {
source = "civo/civo"
version = "1.0.35"
}
# Used to output the kubeconfig to the local dir for local cluster access
local = {
source = "hashicorp/local"
version = "2.4.0"
}
# Used to provision helm charts into the k8s cluster
helm = {
source = "hashicorp/helm"
version = "2.10.1"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.22.0"
}
}
}
# Configure the Civo Provider
provider "civo" {
token = var.civo_token
region = var.region
}
provider "helm" {
kubernetes {
host = civo_kubernetes_cluster.cluster.api_endpoint
client_certificate = base64decode(yamldecode(civo_kubernetes_cluster.cluster.kubeconfig).users[0].user.client-certificate-data)
client_key = base64decode(yamldecode(civo_kubernetes_cluster.cluster.kubeconfig).users[0].user.client-key-data)
cluster_ca_certificate = base64decode(yamldecode(civo_kubernetes_cluster.cluster.kubeconfig).clusters[0].cluster.certificate-authority-data)
}
}
provider "kubernetes" {
host = civo_kubernetes_cluster.cluster.api_endpoint
client_certificate = base64decode(yamldecode(civo_kubernetes_cluster.cluster.kubeconfig).users[0].user.client-certificate-data)
client_key = base64decode(yamldecode(civo_kubernetes_cluster.cluster.kubeconfig).users[0].user.client-key-data)
cluster_ca_certificate = base64decode(yamldecode(civo_kubernetes_cluster.cluster.kubeconfig).clusters[0].cluster.certificate-authority-data)
}