-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AKS Managed Identity configuration can't be used without service_principal
block
#6178
Comments
Apologies, it looks like during the preview period they still need a service principal for specific integration components: https://docs.microsoft.com/en-us/azure/aks/use-managed-identity. Closing for later |
Ah, according to these docs published last night, a service principal is no longer required: https://github.com/Azure/AKS/releases/tag/2020-03-16. Reopening to ask that we determine how to remove the |
Ref hashicorp#6178 service_principal is no longer required as Managed Identity is now GA: https://github.com/Azure/AKS/releases/tag/2020-03-16
Is there a workaround until the fix gets merged? |
Hi @anlutro, you can try to set both provider "azurerm" {
version = "=2.3.0"
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_kubernetes_cluster" "example" {
name = "yourclustername"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
dns_prefix = "yourdns"
default_node_pool {
name = "default"
node_count = 1
vm_size = "Standard_D2_v2"
}
service_principal {
client_id = "00000000-0000-0000-0000-000000000000"
client_secret = "00000000000000000000000000000000"
}
identity {
type = "SystemAssigned"
}
tags = {
Environment = "Production"
}
} |
I've been able to use to "zero" workaround and deploy a cluster with managed identity. |
Also, just noticed that any run after the initial deployment results in a (kind of expected):
|
also 000 is not a valid id to use wrt AD
|
This has been released in version 2.5.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.5.0"
}
# ... other configuration ... |
@tombuildsstuff The identity block that is exported from the AKS Resource, also needs to be added in the AKS Data Source. Existing attribute "servicePrincipalProfile": {
"clientId": "msi"
} |
@syedhassaanahmed mind opening a separate issue to track that? |
@tombuildsstuff After digging more, I conclude that the exported principal from |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output
Expected Behavior
According to #5278, now that system managed identity for AKS is available we should be able to skip the service_principal block in the AKS configuration. The current configuration forces you to set
service_principal
(I believe the update changed back when rebased on PR #5339).Actual Behavior
Steps to Reproduce
Run terraform with the above configuration for AKS. I have a bare subnet and resource group deployed that I am executing terraform against.
Important Factoids
Nothing special
References
managed_cluster_identity
toidentity
#5278The text was updated successfully, but these errors were encountered: