Resource Definitions

Driver

Capability

Resource Type

Agent

Using the Humanitec Agent

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

  • eks-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.
  • eks-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


eks-agent.yaml (view on GitHub) :

# EKS private cluster. It is to be accessed via the Humanitec Agent
# It is using a Cloud Account with temporary credentials
apiVersion: entity.humanitec.io/v1b1
kind: Definition
metadata:
  id: eks-agent
entity:
  name: eks-agent
  type: k8s-cluster
  # The driver_account is referring to a Cloud Account configured in your Organization
  driver_account: aws-temp-creds
  driver_type: humanitec/k8s-cluster-eks
  driver_inputs:
    secrets:
      # Setting the URL for the Humanitec Agent
      agent_url: "${resources['agent#agent'].outputs.url}"
    values:
      region: eu-central-1
      name: demo-123
      loadbalancer: x111111xxx111111111x1xx1x111111x-x111x1x11xx111x1.elb.eu-central-1.amazonaws.com
      loadbalancer_hosted_zone: ABC0DEF5WYYZ00


eks-agent.tf (view on GitHub) :

resource "humanitec_resource_definition" "eks-agent" {
  driver_type    = "humanitec/k8s-cluster-eks"
  id             = "eks-agent"
  name           = "eks-agent"
  type           = "k8s-cluster"
  driver_account = "aws-temp-creds"
  driver_inputs = {
    values_string = jsonencode({
      "region"                   = "eu-central-1"
      "name"                     = "demo-123"
      "loadbalancer"             = "x111111xxx111111111x1xx1x111111x-x111x1x11xx111x1.elb.eu-central-1.amazonaws.com"
      "loadbalancer_hosted_zone" = "ABC0DEF5WYYZ00"
    })
    secrets_string = jsonencode({
      "agent_url" = "$${resources['agent#agent'].outputs.url}"
    })
  }
}


Top