Skip to content

Latest commit

 

History

History
221 lines (185 loc) · 6.84 KB

kafka_connect_v2.md

File metadata and controls

221 lines (185 loc) · 6.84 KB
page_title subcategory description
Conduktor : conduktor_kafka_connect_v2
console/v2
Resource for managing Conduktor Kafka Connect servers definition linked to an existing Kafka cluster definition inside Conduktor Console. This resource allows you to create, read, update and delete Kafka Connect servers connections from Conduktor Console.

conduktor_kafka_connect_v2

Resource for managing Conduktor Kafka Connect servers definition linked to an existing Kafka cluster definition inside Conduktor Console. This resource allows you to create, read, update and delete Kafka Connect servers connections from Conduktor Console.

Example Usage

Simple Kafka Connect server

This example creates a simple Kafka Connect server connection without any authentication.

resource "conduktor_kafka_cluster_v2" "minimal" {
  name = "mini-cluster"
  spec {
    display_name      = "Minimal Cluster"
    bootstrap_servers = "localhost:9092"
  }
}

resource "conduktor_kafka_connect_v2" "simple" {
  name    = "simple-connect"
  cluster = conduktor_kafka_cluster_v2.minimal.name
  spec {
    display_name = "Simple Connect Server"
    urls         = "http://localhost:8083"
  }
}

Basic Kafka Connect server

This example creates a complex Kafka Connect server connection with basic authentication.

resource "conduktor_kafka_cluster_v2" "minimal" {
  name = "mini-cluster"
  spec {
    display_name      = "Minimal Cluster"
    bootstrap_servers = "localhost:9092"
  }
}

resource "conduktor_kafka_connect_v2" "basic" {
  name    = "basic-connect"
  cluster = conduktor_kafka_cluster_v2.minimal.name
  labels = {
    description   = "This is a complex connect using basic authentication"
    documentation = "https://docs.mycompany.com/complex-connect"
    env           = "dev"
  }
  spec {
    display_name = "Basic Connect server"
    urls         = "http://localhost:8083"
    headers = {
      X-PROJECT-HEADER = "value"
      Cache-Control    = "no-cache"
    }
    ignore_untrusted_certificate = false
    security = {
      type     = "BasicAuth"
      username = "user"
      password = "password"
    }
  }
}

Bearer token Kafka Connect server

This example creates a complex Kafka Connect server connection with bearer token authentication.

resource "conduktor_kafka_cluster_v2" "minimal" {
  name = "mini-cluster"
  spec {
    display_name      = "Minimal Cluster"
    bootstrap_servers = "localhost:9092"
  }
}

resource "conduktor_kafka_connect_v2" "bearer" {
  name    = "bearer-connect"
  cluster = conduktor_kafka_cluster_v2.minimal.name
  labels = {
    description   = "This is a complex connect using bearer token authentication"
    documentation = "https://docs.mycompany.com/complex-connect"
    env           = "dev"
  }
  spec {
    display_name = "Bearer Connect server"
    urls         = "http://localhost:8083"
    headers = {
      X-PROJECT-HEADER = "value"
      Cache-Control    = "no-cache"
    }
    ignore_untrusted_certificate = false
    security = {
      type  = "BearerToken"
      token = "token"
    }
  }
}

mTLS Kafka Connect server

This example creates a complex Kafka Connect server connection with mTLS authentication.

resource "conduktor_kafka_cluster_v2" "minimal" {
  name = "mini-cluster"
  spec {
    display_name      = "Minimal Cluster"
    bootstrap_servers = "localhost:9092"
  }
}

resource "conduktor_kafka_connect_v2" "mtls" {
  name    = "mtls-connect"
  cluster = conduktor_kafka_cluster_v2.minimal.name
  labels = {
    description   = "This is a complex connect using mTLS authentication"
    documentation = "https://docs.mycompany.com/complex-connect"
    env           = "dev"
  }
  spec {
    display_name = "mTLS Connect server"
    urls         = "http://localhost:8083"
    headers = {
      X-PROJECT-HEADER = "value"
      Cache-Control    = "no-cache"
    }
    ignore_untrusted_certificate = false
    security = {
      type              = "SSLAuth"
      key               = <<EOT
-----BEGIN PRIVATE KEY-----
MIIOXzCCDUegAwIBAgIRAPRytMVYJNUgCbhnA+eYumgwDQYJKoZIhvcNAQELBQAw
...
IFyCs+xkcgvHFtBjjel4pnIET0agtbGJbGDEQBNxX+i4MDA=
-----END PRIVATE KEY-----
EOT
      certificate_chain = <<EOT
-----BEGIN CERTIFICATE-----
MIIOXzCCDUegAwIBAgIRAPRytMVYJNUgCbhnA+eYumgwDQYJKoZIhvcNAQELBQAw
...
IFyCs+xkcgvHFtBjjel4pnIET0agtbGJbGDEQBNxX+i4MDA=
-----END CERTIFICATE-----
EOT
    }
  }
}

Schema

Required

  • cluster (String) Kafka cluster name linked with Kafka current connect server. Must exist in Conduktor Console
  • name (String) Kafka connect server name, must be unique, act as ID for import

Optional

Nested Schema for spec

Required:

  • display_name (String) Kafka connect server display name
  • urls (String) URL of a Kafka Connect cluster. Multiple URLs are not supported for now

Optional:

  • headers (Map of String) Key-Value HTTP headers to add to requests
  • ignore_untrusted_certificate (Boolean) Ignore untrusted certificate for Kafka connect server requests
  • security (Attributes) Kafka connect server security configuration. One of BasicAuth, BearerToken, SSLAuth (see below for nested schema)

Nested Schema for spec.security

Required:

  • type (String) Kafka connect server security type. Either BasicAuth, BearerToken, SSLAuth

More detail on our documentation

Optional:

  • certificate_chain (String) Kafka connect server mTLS auth certificate chain PEM. Required if security type is SSLAuth
  • key (String, Sensitive) Kafka connect server mTLS auth private key PEM. Required if security type is SSLAuth
  • password (String, Sensitive) Kafka connect server basic auth password. Required if security type is BasicAuth
  • token (String, Sensitive) Kafka connect server bearer token. Required if security type is BearerToken
  • username (String) Kafka connect server basic auth username. Required if security type is BasicAuth

Import

In order to import a Kafka Connect server connection into Conduktor, you need to know the Kafka cluster ID and the Kafka Connect server ID.

The import ID is constructed as follows: < cluster_id >/< connect_id >.

For example, using an import block :

import {
  to = conduktor_kafka_connect_v2.example
  id = "mini-cluster/import-connect" # Import "import-connect" Connect server for "mini-cluster" Kafka cluster
}

Using the terraform import command:

terraform import conduktor_kafka_connect_v2.example mini-cluster/import-connect