|
| 1 | +--- |
| 2 | +page_title: "Conduktor : conduktor_kafka_connect_v2 " |
| 3 | +subcategory: "console/v2" |
| 4 | +description: |- |
| 5 | + Resource for managing Conduktor Kafka Connect servers definition linked to an existing Kafka cluster inside Console. |
| 6 | + This resource allows you to create, read, update and delete Kafka Connect servers in Conduktor. |
| 7 | +--- |
| 8 | + |
| 9 | +# conduktor_kafka_connect_v2 |
| 10 | + |
| 11 | +Resource for managing Conduktor Kafka connect servers definition linked to an existing Kafka cluster inside Console. |
| 12 | +This resource allows you to create, read, update and delete Kafka Connect servers in Conduktor. |
| 13 | + |
| 14 | +## Example Usage |
| 15 | + |
| 16 | +### Simple Kafka Connect server |
| 17 | +This example creates a simple Kafka Connect server without any authentication. |
| 18 | +```terraform |
| 19 | +resource "conduktor_kafka_cluster_v2" "minimal" { |
| 20 | + name = "mini-cluster" |
| 21 | + spec { |
| 22 | + display_name = "Minimal Cluster" |
| 23 | + bootstrap_servers = "localhost:9092" |
| 24 | + } |
| 25 | +} |
| 26 | +
|
| 27 | +resource "conduktor_kafka_connect_v2" "simple" { |
| 28 | + name = "simple-connect" |
| 29 | + cluster = conduktor_kafka_cluster_v2.minimal.name |
| 30 | + spec { |
| 31 | + display_name = "Simple Connect Server" |
| 32 | + urls = "http://localhost:8083" |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +### Basic Kafka Connect server |
| 38 | +This example creates a complex Kafka Connect server with basic authentication. |
| 39 | +```terraform |
| 40 | +resource "conduktor_kafka_cluster_v2" "minimal" { |
| 41 | + name = "mini-cluster" |
| 42 | + spec { |
| 43 | + display_name = "Minimal Cluster" |
| 44 | + bootstrap_servers = "localhost:9092" |
| 45 | + } |
| 46 | +} |
| 47 | +
|
| 48 | +resource "conduktor_kafka_connect_v2" "basic" { |
| 49 | + name = "basic-connect" |
| 50 | + cluster = conduktor_kafka_cluster_v2.minimal.name |
| 51 | + labels = { |
| 52 | + description = "This is a complex connect using basic authentication" |
| 53 | + documentation = "https://docs.mycompany.com/complex-connect" |
| 54 | + env = "dev" |
| 55 | + } |
| 56 | + spec { |
| 57 | + display_name = "Basic Connect server" |
| 58 | + urls = "http://localhost:8083" |
| 59 | + headers = { |
| 60 | + X-PROJECT-HEADER = "value" |
| 61 | + Cache-Control : "no-cache" |
| 62 | + } |
| 63 | + ignore_untrusted_certificate = false |
| 64 | + security = { |
| 65 | + type = "BasicAuth" |
| 66 | + username = "user" |
| 67 | + password = "password" |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +### Bearer token Kafka Connect server |
| 74 | +This example creates a complex Kafka Connect server with bearer token authentication. |
| 75 | +```terraform |
| 76 | +resource "conduktor_kafka_cluster_v2" "minimal" { |
| 77 | + name = "mini-cluster" |
| 78 | + spec { |
| 79 | + display_name = "Minimal Cluster" |
| 80 | + bootstrap_servers = "localhost:9092" |
| 81 | + } |
| 82 | +} |
| 83 | +
|
| 84 | +resource "conduktor_kafka_connect_v2" "bearer" { |
| 85 | + name = "bearer-connect" |
| 86 | + cluster = conduktor_kafka_cluster_v2.minimal.name |
| 87 | + labels = { |
| 88 | + description = "This is a complex connect using bearer token authentication" |
| 89 | + documentation = "https://docs.mycompany.com/complex-connect" |
| 90 | + env = "dev" |
| 91 | + } |
| 92 | + spec { |
| 93 | + display_name = "Bearer Connect server" |
| 94 | + urls = "http://localhost:8083" |
| 95 | + headers = { |
| 96 | + X-PROJECT-HEADER = "value" |
| 97 | + Cache-Control : "no-cache" |
| 98 | + } |
| 99 | + ignore_untrusted_certificate = false |
| 100 | + security = { |
| 101 | + type = "BearerToken" |
| 102 | + token = "token" |
| 103 | + } |
| 104 | + } |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +### mTLS Kafka Connect server |
| 109 | +This example creates a complex Kafka Connect server with mTLS authentication. |
| 110 | +```terraform |
| 111 | +resource "conduktor_kafka_cluster_v2" "minimal" { |
| 112 | + name = "mini-cluster" |
| 113 | + spec { |
| 114 | + display_name = "Minimal Cluster" |
| 115 | + bootstrap_servers = "localhost:9092" |
| 116 | + } |
| 117 | +} |
| 118 | +
|
| 119 | +resource "conduktor_kafka_connect_v2" "mtls" { |
| 120 | + name = "mtls-connect" |
| 121 | + cluster = conduktor_kafka_cluster_v2.minimal.name |
| 122 | + labels = { |
| 123 | + description = "This is a complex connect using mTLS authentication" |
| 124 | + documentation = "https://docs.mycompany.com/complex-connect" |
| 125 | + env = "dev" |
| 126 | + } |
| 127 | + spec { |
| 128 | + display_name = "mTLS Connect server" |
| 129 | + urls = "http://localhost:8083" |
| 130 | + headers = { |
| 131 | + X-PROJECT-HEADER = "value" |
| 132 | + Cache-Control : "no-cache" |
| 133 | + } |
| 134 | + ignore_untrusted_certificate = false |
| 135 | + security = { |
| 136 | + type = "SSLAuth" |
| 137 | + key = <<EOT |
| 138 | +-----BEGIN PRIVATE KEY----- |
| 139 | +MIIOXzCCDUegAwIBAgIRAPRytMVYJNUgCbhnA+eYumgwDQYJKoZIhvcNAQELBQAw |
| 140 | +... |
| 141 | +IFyCs+xkcgvHFtBjjel4pnIET0agtbGJbGDEQBNxX+i4MDA= |
| 142 | +-----END PRIVATE KEY----- |
| 143 | +EOT |
| 144 | + certificate_chain = <<EOT |
| 145 | +-----BEGIN CERTIFICATE----- |
| 146 | +MIIOXzCCDUegAwIBAgIRAPRytMVYJNUgCbhnA+eYumgwDQYJKoZIhvcNAQELBQAw |
| 147 | +... |
| 148 | +IFyCs+xkcgvHFtBjjel4pnIET0agtbGJbGDEQBNxX+i4MDA= |
| 149 | +-----END CERTIFICATE----- |
| 150 | +EOT |
| 151 | + } |
| 152 | + } |
| 153 | +} |
| 154 | +``` |
| 155 | + |
| 156 | +<!-- schema generated by tfplugindocs --> |
| 157 | +## Schema |
| 158 | + |
| 159 | +### Required |
| 160 | + |
| 161 | +- `cluster` (String) Kafka cluster name linked with Kafka current connect server. Must exist in Conduktor Console |
| 162 | +- `name` (String) Kafka connect server name, must be unique, act as ID for import |
| 163 | + |
| 164 | +### Optional |
| 165 | + |
| 166 | +- `labels` (Map of String) Kafka connect server labels |
| 167 | +- `spec` (Block, Optional) (see [below for nested schema](#nestedblock--spec)) |
| 168 | + |
| 169 | +<a id="nestedblock--spec"></a> |
| 170 | +### Nested Schema for `spec` |
| 171 | + |
| 172 | +Required: |
| 173 | + |
| 174 | +- `display_name` (String) Kafka connect server display name |
| 175 | +- `urls` (String) URL of a Kafka Connect cluster. **Multiple URLs are not supported for now** |
| 176 | + |
| 177 | +Optional: |
| 178 | + |
| 179 | +- `headers` (Map of String) Key-Value HTTP headers to add to requests |
| 180 | +- `ignore_untrusted_certificate` (Boolean) Ignore untrusted certificate for Kafka connect server requests |
| 181 | +- `security` (Attributes) Kafka connect server security configuration. One of `BasicAuth`, `BearerToken`, `SSLAuth` (see [below for nested schema](#nestedatt--spec--security)) |
| 182 | + |
| 183 | +<a id="nestedatt--spec--security"></a> |
| 184 | +### Nested Schema for `spec.security` |
| 185 | + |
| 186 | +Required: |
| 187 | + |
| 188 | +- `type` (String) Kafka connect server security type. Either `BasicAuth`, `BearerToken`, `SSLAuth` |
| 189 | + |
| 190 | + More detail on our [documentation](https://docs.conduktor.io/platform/reference/resource-reference/console/#kafkaconnectcluster) |
| 191 | + |
| 192 | +Optional: |
| 193 | + |
| 194 | +- `certificate_chain` (String) Kafka connect server mTLS auth certificate chain PEM. Required if security type is `SSLAuth` |
| 195 | +- `key` (String, Sensitive) Kafka connect server mTLS auth private key PEM. Required if security type is `SSLAuth` |
| 196 | +- `password` (String, Sensitive) Kafka connect server basic auth password. Required if security type is `BasicAuth` |
| 197 | +- `token` (String, Sensitive) Kafka connect server bearer token. Required if security type is `BearerToken` |
| 198 | +- `username` (String) Kafka connect server basic auth username. Required if security type is `BasicAuth` |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | +## Import |
| 205 | + |
| 206 | +In order to import a Kafka Connect server into Conduktor, you need to know the Kafka cluster ID and the Kafka Connect server ID. |
| 207 | + |
| 208 | +The import ID is constructed as follows: `< cluster_id >/< connect_id >`. |
| 209 | + |
| 210 | +For example, using an [`import` block](https://developer.hashicorp.com/terraform/language/import) : |
| 211 | +```terraform |
| 212 | +import { |
| 213 | + to = conduktor_kafka_connect_v2.example |
| 214 | + id = "mini-cluster/import-connect" # Import "import-connect" Connect server for "mini-cluster" Kafka cluster |
| 215 | +} |
| 216 | +``` |
| 217 | + |
| 218 | +Using the `terraform import` command: |
| 219 | +```shell |
| 220 | +terraform import conduktor_kafka_connect_v2.example mini-cluster/import-connect |
| 221 | +``` |
0 commit comments