From 4032e5167e8e10836dd997c76870666d61e62948 Mon Sep 17 00:00:00 2001 From: Deepanshu Marwah Date: Tue, 28 Jul 2020 20:41:47 +0800 Subject: [PATCH] Replaced systmAssigned identity with service prinicpal (patch) --- modules/azure-kubernetes-cluster/main.tf | 5 +++-- modules/azure-kubernetes-cluster/vars.tf | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/azure-kubernetes-cluster/main.tf b/modules/azure-kubernetes-cluster/main.tf index cd98a92..90f0f88 100644 --- a/modules/azure-kubernetes-cluster/main.tf +++ b/modules/azure-kubernetes-cluster/main.tf @@ -15,8 +15,9 @@ resource "azurerm_kubernetes_cluster" "K8s" { private_cluster_enabled = var.private_cluster_enabled dns_prefix = var.dns_prefix - identity { - type = var.identity_type + service_principal { + client_id = var.client_id + client_secret = var.client_secret } network_profile { diff --git a/modules/azure-kubernetes-cluster/vars.tf b/modules/azure-kubernetes-cluster/vars.tf index c44ad93..11309dc 100644 --- a/modules/azure-kubernetes-cluster/vars.tf +++ b/modules/azure-kubernetes-cluster/vars.tf @@ -42,6 +42,15 @@ variable "identity_type" { default = "SystemAssigned" } +variable "client_id" { + description = "This is the client id of azure AD application." + type = string +} + +variable "client_secret" { + description = "This is the client secret of azure AD application." +} + variable "network_plugin" { description = "Network plugin to use for networking." type = string