Skip to content

Commit

Permalink
Replaced use of service principal with identity
Browse files Browse the repository at this point in the history
  • Loading branch information
TomArcherMsft committed May 28, 2023
1 parent 99fa801 commit 05bf429
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 51 deletions.
10 changes: 4 additions & 6 deletions quickstart/201-k8s-cluster-with-tf-and-aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ resource "azurerm_kubernetes_cluster" "k8s" {
resource_group_name = azurerm_resource_group.rg.name
dns_prefix = random_pet.azurerm_kubernetes_cluster_dns_prefix.id

identity {
type = "SystemAssigned"
}

default_node_pool {
name = "agentpool"
vm_size = "Standard_D2_v2"
Expand All @@ -38,10 +42,4 @@ resource "azurerm_kubernetes_cluster" "k8s" {
network_plugin = "kubenet"
load_balancer_sku = "standard"
}
service_principal {
client_id = azuread_service_principal.app.application_id
client_secret = azuread_service_principal_password.app.value
}

depends_on = [time_sleep.wait_30_seconds]
}
2 changes: 0 additions & 2 deletions quickstart/201-k8s-cluster-with-tf-and-aks/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ This template provisions an [AKS / Azure Kubernetes service (also known as a Man
- [azurerm_client_config](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config)
- [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster)
- [azuread_application](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/application)
- [azuread_service_principal](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/service_principal)
- [azuread_service_principal_password](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/service_principal_password)
- [azapi_resource](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/azapi_resource)
- [azapi_resource_action](https://registry.terraform.io/providers/Azure/azapi/latest/docs/resources/azapi_resource_action)

Expand Down
43 changes: 0 additions & 43 deletions quickstart/201-k8s-cluster-with-tf-and-aks/sp.tf

This file was deleted.

0 comments on commit 05bf429

Please sign in to comment.