-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.tf
56 lines (49 loc) · 1.54 KB
/
init.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
terraform {
required_version = ">= 1.2.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.75.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.20.0"
}
helm = {
source = "hashicorp/helm"
version = ">= 2.11.0"
}
null = {
version = ">= 3.2.0"
}
random = {
source = "hashicorp/random"
version = ">= 3.5.1"
}
}
}
provider "kubernetes" {
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.cluster.kube_config[0].cluster_ca_certificate)
host = data.azurerm_kubernetes_cluster.cluster.kube_config[0].host
token = data.azurerm_kubernetes_cluster.cluster.kube_config[0].password
}
provider "helm" {
kubernetes {
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.cluster.kube_config[0].cluster_ca_certificate)
host = data.azurerm_kubernetes_cluster.cluster.kube_config[0].host
token = data.azurerm_kubernetes_cluster.cluster.kube_config[0].password
}
}
data "azurerm_kubernetes_cluster" "cluster" {
name = var.cluster_name
resource_group_name = var.cluster_resource_group_name
}
data "azurerm_dns_zone" "primary" {
name = var.domain_name
resource_group_name = var.dns_zone_resource_group_name
}
data "azurerm_resource_group" "dns" {
name = var.dns_zone_resource_group_name
}
data "azurerm_subscription" "current" {}
data "azurerm_client_config" "current" {}