-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproviders.tf
More file actions
46 lines (38 loc) · 1.31 KB
/
providers.tf
File metadata and controls
46 lines (38 loc) · 1.31 KB
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
terraform {
required_version = ">= 1.5.0"
required_providers {
stackit = {
source = "stackitcloud/stackit"
version = ">= 0.94.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.30.0"
}
time = {
source = "hashicorp/time"
version = ">= 0.11.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.6.0"
}
}
}
provider "stackit" {
default_region = var.region
service_account_key_path = pathexpand(var.service_account_key_path)
}
resource "stackit_ske_kubeconfig" "replatform" {
project_id = local.effective_project_id
cluster_name = stackit_ske_cluster.replatform.name
refresh = true
expiration = 7200
refresh_before = 1800
}
provider "kubernetes" {
host = yamldecode(stackit_ske_kubeconfig.replatform.kube_config).clusters[0].cluster.server
client_certificate = base64decode(yamldecode(stackit_ske_kubeconfig.replatform.kube_config).users[0].user["client-certificate-data"])
client_key = base64decode(yamldecode(stackit_ske_kubeconfig.replatform.kube_config).users[0].user["client-key-data"])
cluster_ca_certificate = base64decode(yamldecode(stackit_ske_kubeconfig.replatform.kube_config).clusters[0].cluster["certificate-authority-data"])
}