A Terraform plugin for managing Confluent KSQL Server.
Download and extract the latest
release to
your [terraform plugin directory][third-party-plugins] (typically ~/.terraform.d/plugins/
)
-
Clone repository to:
$GOPATH/src/github.com/Mongey/terraform-provider-ksql
mkdir -p $GOPATH/src/github.com/Mongey/terraform-provider-ksql; cd $GOPATH/src/github.com/Mongey/ git clone https://github.com/Mongey/terraform-provider-ksql.git
-
Build the provider
make build
-
Run the tests
make test
-
Build the provider
make build
provider "ksql" {
url = "http://localhost:8083"
}
A resource for managing KSQL streams
resource "ksql_stream" "actions" {
name = "vip_actions"
query = "SELECT userid, page, action
FROM clickstream c
LEFT JOIN users u ON c.userid = u.user_id
WHERE u.level =
'Platinum';"
}
A resource for managing KSQL tables
resource "ksql_table" "users" {
name = "users-thing"
query = "SELECT error_code,
count(*),
FROM monitoring_stream
WINDOW TUMBLING (SIZE 1 MINUTE)
WHERE type = 'ERROR'
GROUP BY error_code;"
}
}