A Terraform plugin for managing Apache Kafka Connect.
Download and extract the latest
release to
your terraform plugin directory (typically ~/.terraform.d/plugins/
)
Configure the provider directly, or set the ENV variable KAFKA_CONNECT_URL
provider "kafka-connect" {
url = "http://localhost:8083"
basic_auth_username = "user" # Optional
basic_auth_password = "password" # Optional
# For TLS
tls_auth_crt = "/tmp/cert.pem" # Optional
tls_auth_key = "/tmp/key.pem " # Optional
tls_auth_is_insecure = true # Optionnal if you do not want to check CA
}
resource "kafka-connect_connector" "sqlite-sink" {
name = "sqlite-sink"
config = {
"name" = "sqlite-sink"
"connector.class" = "io.confluent.connect.jdbc.JdbcSinkConnector"
"tasks.max" = 1
"topics" = "orders"
"connection.url" = "jdbc:sqlite:test.db"
"auto.create" = "true"
"connection.user" = "admin"
}
config_sensitive = {
"connection.password" = "this-should-never-appear-unmasked"
}
}
Property | Type | Example | Alternative environment variable name |
---|---|---|---|
url |
URL | "http://localhost:8083" | KAFKA_CONNECT_URL |
basic_auth_username |
String | "user" | KAFKA_CONNECT_BASIC_AUTH_USERNAME |
basic_auth_password |
String | "password" | KAFKA_CONNECT_BASIC_AUTH_PASSWORD |
tls_auth_crt |
String | "certificate" | KAFKA_CONNECT_TLS_AUTH_CRT |
tls_auth_key |
String | "Key" | KAFKA_CONNECT_TLS_AUTH_KEY |
tls_auth_is_insecure |
String | "Key" | KAFKA_CONNECT_TLS_IS_INSECURE |
headers |
Map[String]String | {foo = "bar"} | N/A |
Property | Type | Description |
---|---|---|
name |
String | Connector name |
config |
HCL Block | Connector configuration |
config_sensitive |
HCL Block | Sensitive connector configuration. Will be masked in output. |
- Install go
- Clone repository to:
$GOPATH/src/github.com/Mongey/terraform-provider-kafka-connect
mkdir -p $GOPATH/src/github.com/Mongey/terraform-provider-kafka-connect; cd $GOPATH/src/github.com/Mongey/ git clone https://github.com/Mongey/terraform-provider-kafka-connect.git
- Build the provider
make build
- Run the tests
make test
- Run acceptance tests
make testacc