Resource Definitions

Driver

Capability

Dynamic Credentials

Using dynamic credentials

This section contains example Resource Definitions using dynamic credentials for connecting to AKS clusters.

  • aks-dynamic-credentials.yaml: use dynamic credentials defined via a Cloud Account. This format is for use with the Humanitec CLI
  • aks-dynamic-credentials.tf: uses dynamic credentials defined via a Cloud Account. This format is for use with the Humanitec Terraform provider

aks-dynamic-credentials.tf (view on GitHub) :

# Connect to an AKS cluster using dynamic credentials defined via a Cloud Account
resource "humanitec_resource_definition" "aks-dynamic-credentials" {
  id          = "aks-dynamic-credentials"
  name        = "aks-dynamic-credentials"
  type        = "k8s-cluster"
  driver_type = "humanitec/k8s-cluster-aks"
  # The driver_account is referring to a Cloud Account resource
  driver_account = humanitec_resource_account.azure-dynamic.id

  driver_inputs = {
    values_string = jsonencode({
      "name"            = var.azure_aks_private_cluster_name
      "loadbalancer"    = var.azure_aks_private_cluster_loadbalancer
      "resource_group"  = var.azure_aks_resource_group
      "subscription_id" = var.azure_subscription_id
      # Add this exact server_app_id for a cluster using AKS-managed Entra ID integration
      # "server_app_id" = "6dae42f8-4368-4678-94ff-3960e28e3630"
    })
  }
}


aks-dynamic-credentials.yaml (view on GitHub) :

# Connect to an AKS cluster using dynamic credentials defined via a Cloud Account
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: aks-dynamic-credentials
entity:
  name: aks-dynamic-credentials
  type: k8s-cluster
  # The driver_account references a Cloud Account of type "azure-identity"
  # which needs to be configured for your Organization.
  driver_account: azure-dynamic-creds
  driver_type: humanitec/k8s-cluster-aks
  driver_inputs:
    values:
      loadbalancer: 20.10.10.10
      name: demo-123
      resource_group: my-resources
      subscription_id: 12345678-aaaa-bbbb-cccc-0987654321ba
      # Add this exact server_app_id for a cluster using AKS-managed Entra ID integration
      # server_app_id: 6dae42f8-4368-4678-94ff-3960e28e3630
Top