From a55d19e86f7fc52a24ae3805cf77f2de41036b16 Mon Sep 17 00:00:00 2001 From: Matt Betts Date: Thu, 26 Jul 2018 07:21:34 -0400 Subject: [PATCH] Aks node resource group (#1649) * adding support for node_resource_group * Fixing syntax error * Changing language in documentation --- azurerm/data_source_kubernetes_cluster.go | 6 ++++++ azurerm/resource_arm_kubernetes_cluster.go | 6 ++++++ website/docs/d/kubernetes_cluster.html.markdown | 2 ++ website/docs/r/kubernetes_cluster.html.markdown | 2 ++ 4 files changed, 16 insertions(+) diff --git a/azurerm/data_source_kubernetes_cluster.go b/azurerm/data_source_kubernetes_cluster.go index 1f11c2dfdc68..ae3255e6c1bd 100644 --- a/azurerm/data_source_kubernetes_cluster.go +++ b/azurerm/data_source_kubernetes_cluster.go @@ -38,6 +38,11 @@ func dataSourceArmKubernetesCluster() *schema.Resource { Computed: true, }, + "node_resource_group": { + Type: schema.TypeString, + Computed: true, + }, + "kube_config": { Type: schema.TypeList, Computed: true, @@ -233,6 +238,7 @@ func dataSourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{} d.Set("dns_prefix", props.DNSPrefix) d.Set("fqdn", props.Fqdn) d.Set("kubernetes_version", props.KubernetesVersion) + d.Set("node_resource_group", props.NodeResourceGroup) linuxProfile := flattenKubernetesClusterDataSourceLinuxProfile(props.LinuxProfile) if err := d.Set("linux_profile", linuxProfile); err != nil { diff --git a/azurerm/resource_arm_kubernetes_cluster.go b/azurerm/resource_arm_kubernetes_cluster.go index 3d7821c9497a..3f0dd5cc14fd 100644 --- a/azurerm/resource_arm_kubernetes_cluster.go +++ b/azurerm/resource_arm_kubernetes_cluster.go @@ -75,6 +75,11 @@ func resourceArmKubernetesCluster() *schema.Resource { Computed: true, }, + "node_resource_group": { + Type: schema.TypeString, + Computed: true, + }, + "kube_config": { Type: schema.TypeList, Computed: true, @@ -394,6 +399,7 @@ func resourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{}) d.Set("dns_prefix", props.DNSPrefix) d.Set("fqdn", props.Fqdn) d.Set("kubernetes_version", props.KubernetesVersion) + d.Set("node_resource_group", props.NodeResourceGroup) linuxProfile := flattenAzureRmKubernetesClusterLinuxProfile(props.LinuxProfile) if err := d.Set("linux_profile", linuxProfile); err != nil { diff --git a/website/docs/d/kubernetes_cluster.html.markdown b/website/docs/d/kubernetes_cluster.html.markdown index 593ceb8ddcd4..fe538fe2846c 100644 --- a/website/docs/d/kubernetes_cluster.html.markdown +++ b/website/docs/d/kubernetes_cluster.html.markdown @@ -41,6 +41,8 @@ The following attributes are exported: * `kube_config_raw` - Base64 encoded Kubernetes configuration. +* `node_resource_group` - Auto-generated Resource Group containing AKS Cluster resources. + * `kube_config` - A `kube_config` block as defined below. * `location` - The Azure Region in which the managed Kubernetes Cluster exists. diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index 124850b5fd1a..7f590df5b58f 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -267,6 +267,8 @@ The following attributes are exported: * `fqdn` - The FQDN of the Azure Kubernetes Managed Cluster. +* `node_resource_group` - Auto-generated Resource Group containing AKS Cluster resources. + * `kube_config_raw` - Base64 encoded Kubernetes configuration * `kube_config` - Kubernetes configuration, sub-attributes defined below: