Skip to content

Commit

Permalink
Documenting how to use the AKS data source with the K8S Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed May 6, 2018
1 parent 0a42750 commit 4b44723
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions azurerm/data_source_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ func dataSourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{}
return nil
}

return fmt.Errorf("Error making Read request on AKS Managed Cluster %q (resource group %q): %+v", name, resGroup, err)
return fmt.Errorf("Error making Read request on AKS Managed Cluster %q (resource group %q): %+v", name, resourceGroup, err)
}

profile, err := kubernetesClustersClient.GetAccessProfiles(ctx, resourceGroup, name, "clusterUser")
if err != nil {
return fmt.Errorf("Error getting access profile while making Read request on AKS Managed Cluster %q (resource group %q): %+v", name, resGroup, err)
return fmt.Errorf("Error getting access profile while making Read request on AKS Managed Cluster %q (resource group %q): %+v", name, resourceGroup, err)
}

d.SetId(*resp.ID)
Expand Down
13 changes: 13 additions & 0 deletions website/docs/d/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ The following attributes are exported:

* `password` - A password or token used to authenticate to the Kubernetes cluster.

-> **NOTE:** It's possible to use these credentials with [the Kubernetes Provider](/docs/providers/kubernetes/index.html) like so:

```
provider "kubernetes" {
host = "${data.azurerm_kubernetes_cluster.main.kube_config.0.host}"
username = "${data.azurerm_kubernetes_cluster.main.kube_config.0.username}"
password = "${data.azurerm_kubernetes_cluster.main.kube_config.0.password}"
client_certificate = "${base64decode(data.azurerm_kubernetes_cluster.main.kube_config.0.client_certificate)}"
client_key = "${base64decode(data.azurerm_kubernetes_cluster.main.kube_config.0.client_key)}"
cluster_ca_certificate = "${base64decode(data.azurerm_kubernetes_cluster.main.kube_config.0.cluster_ca_certificate)}"
}
```

`linux_profile` exports the following:

* `admin_username` - The username associated with the administrator account of the managed Kubernetes Cluster.
Expand Down

0 comments on commit 4b44723

Please sign in to comment.