Skip to content

Commit

Permalink
fix azure provider versions (#526)
Browse files Browse the repository at this point in the history
Signed-off-by: DavidSpek <[email protected]>

Signed-off-by: DavidSpek <[email protected]>
  • Loading branch information
davidspek authored Sep 14, 2022
1 parent 34fc2b7 commit 2ebca32
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions apps/core/priv/scaffolds/terraform/providers/0.1.2/azure.eex
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
terraform {
backend "azurerm" {
storage_account_name = {{ .Values.Context.StorageAccount | quote }}
resource_group_name = {{ .Values.ResourceGroup | quote }}
container_name = {{ .Values.Bucket | quote }}
key = "{{ .Values.__CLUSTER__ }}/{{ .Values.Prefix }}/terraform.tfstate"
}

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.22.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.5.0"
}
}
}

provider "azurerm" {
features {}
}

{{ if .Values.ClusterCreated }}
provider "kubernetes" {
host = {{ .Values.Cluster }}.host
client_certificate = base64decode({{ .Values.Cluster }}.client_certificate)
client_key = base64decode({{ .Values.Cluster }}.client_key)
cluster_ca_certificate = base64decode({{ .Values.Cluster }}.cluster_ca_certificate)
}
{{ else }}
data "azurerm_kubernetes_cluster" "cluster" {
name = {{ .Values.Cluster }}
resource_group_name = {{ .Values.ResourceGroup | quote }}
}

provider "kubernetes" {
host = data.azurerm_kubernetes_cluster.cluster.kube_config[0].host
client_certificate = base64decode(data.azurerm_kubernetes_cluster.cluster.kube_config[0].client_certificate)
client_key = base64decode(data.azurerm_kubernetes_cluster.cluster.kube_config[0].client_key)
cluster_ca_certificate = base64decode(data.azurerm_kubernetes_cluster.cluster.kube_config[0].cluster_ca_certificate)
}
{{ end }}

0 comments on commit 2ebca32

Please sign in to comment.