Live Webinar
Write an infrastructure application in TypeScript and Python using CDK for Terraform

Learn the

Provision, Secure, Connect, and Run

Any infrastructure for any application

» azuredevops_serviceendpoint_kubernetes

Manages a Kubernetes service endpoint within Azure DevOps.

» Example Usage

data "azuredevops_project" "p" {
  project_name = "contoso"
}

resource "azuredevops_serviceendpoint_kubernetes" "se_azure_sub" {
  project_id            = data.azuredevops_project.p
  service_endpoint_name = "Sample Kubernetes"
  apiserver_url         = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"
  authorization_type    = "AzureSubscription"

  azure_subscription {
    subscription_id   = "001ac454-bb17-475a-8648-82c4234545be" # fake value
    subscription_name = "Microsoft Azure DEMO"
    tenant_id         = "8c46c3eb-ca1f-4a0b-8dfa-7c3baaf69d45" # fake value
    resourcegroup_id  = "sample-rg"
    namespace         = "default"
    cluster_name      = "sample-aks"
  }
}

resource "azuredevops_serviceendpoint_kubernetes" "se_kubeconfig" {
  project_id            = data.azuredevops_project.p
  service_endpoint_name = "Sample Kubernetes"
  apiserver_url         = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"
  authorization_type    = "Kubeconfig"

  kubeconfig {
    kube_config            = <<EOT
                              apiVersion: v1
                              clusters:
                              - cluster:
                                  certificate-authority: fake-ca-file
                                  server: https://1.2.3.4
                                name: development
                              contexts:
                              - context:
                                  cluster: development
                                  namespace: frontend
                                  user: developer
                                name: dev-frontend
                              current-context: dev-frontend
                              kind: Config
                              preferences: {}
                              users:
                              - name: developer
                                user:
                                  client-certificate: fake-cert-file
                                  client-key: fake-key-file
                             EOT
    accept_untrusted_certs = true
    cluster_context        = "dev-frontend"
  }
}

resource "azuredevops_serviceendpoint_kubernetes" "se_service_account" {
  project_id            = data.azuredevops_project.p
  service_endpoint_name = "Sample Kubernetes"
  apiserver_url         = "https://sample-kubernetes-cluster.hcp.westeurope.azmk8s.io"
  authorization_type    = "ServiceAccount"

  service_account {
    token   = "bXktYXBw[...]K8bPxc2uQ=="
    ca_cert = "Mzk1MjgkdmRnN0pi[...]mHHRUH14gw4Q=="
  }
}

» Argument Reference

The following arguments are supported:

» Attributes Reference

The following attributes are exported: