Resource Definitions

Driver

Capability

Flavor

Resource Type

Agent

Using the Humanitec Agent

This section contains example Resource Definitions using the Humanitec Agent for connecting to AKS clusters.

  • aks-agent.yaml: uses a Cloud Account as well as the Humanitec Agent to access this private cluster. This format is for use with the Humanitec CLI .
  • aks-agent.tf: uses a Cloud Account as well as the Humanitec Agent to access this private cluster. This format is for use with the Humanitec Terraform provider

Resource Definitions


aks-agent.yaml ( view on GitHub ) :

# AKS private cluster. It is to be accessed via the Humanitec Agent
# It is using a Cloud Account to obtain credentials
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: aks-agent
entity:
  name: aks-agent
  type: k8s-cluster
  # The driver_account is referring to a Cloud Account configured in your Organization
  driver_account: azure-temporary
  driver_type: humanitec/k8s-cluster-aks
  driver_inputs:
    secrets:
      # Setting the URL for the Humanitec Agent
      agent_url: "${resources['agent#agent'].outputs.url}"
    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


aks-agent.tf ( view on GitHub ) :

resource "humanitec_resource_definition" "aks-agent" {
  driver_type    = "humanitec/k8s-cluster-aks"
  id             = "aks-agent"
  name           = "aks-agent"
  type           = "k8s-cluster"
  driver_account = "azure-temporary"
  driver_inputs = {
    values_string = jsonencode({
      "loadbalancer"    = "20.10.10.10"
      "name"            = "demo-123"
      "resource_group"  = "my-resources"
      "subscription_id" = "12345678-aaaa-bbbb-cccc-0987654321ba"
      "server_app_id"   = "6dae42f8-4368-4678-94ff-3960e28e3630"
    })
    secrets_string = jsonencode({
      "agent_url" = "$${resources['agent#agent'].outputs.url}"
    })
  }
}


Top