streamtime_kafka (Resource)
A Kafka cluster on a fleet. Creating one deploys the cluster and waits until it is ready. Changes to its settings are saved, but a running cluster keeps its current settings until Streamtime can apply changes to running clusters.
Example Usage
# A Kafka cluster on an existing fleet. Apply waits until the cluster is ready.
resource "streamtime_kafka" "orders" {
identifier = "orders"
workload = "strimzi"
fleet = streamtime_fleet.byok.identifier
kafka_units = 3
tags = {
team = "payments"
}
# Component versions, values and authentication. The fields depend on the workload.
advanced_config = jsonencode({})
timeouts = {
create = "60m"
delete = "60m"
}
}
output "bootstrap_servers" {
value = jsondecode(streamtime_kafka.orders.spec).bootstrapServers
}
Schema
Required
identifier(String) Unique name of the cluster: up to 24 lowercase letters, digits and dashes. Changing it creates a new cluster.kafka_units(Number) Cluster capacity, in capacity units.workload(String) Kafka provider of the cluster, for example strimzi, cfk, redpanda, warpstream or cpansible (Confluent Platform on your own virtual machines). Changing it creates a new cluster.
Optional
advanced_config(String, Sensitive) Advanced settings, as a JSON object set with jsonencode(): component versions, values and authentication. The fields depend on workload and may include credentials. Settings Streamtime fills in are not shown as changes.alert_webhook_secret(String, Sensitive) Secret used to sign the cluster’s alert webhooks. Streamtime never returns it.cloud_provider(String) Cloud the cluster runs in, used to choose a fleet.fleet(String) Identifier of the fleet to deploy the cluster on. Leave it out to let Streamtime choose a fleet with room for the cluster’s capacity, tenancy mode and cloud. Changing it creates a new cluster.metadata(String) Free-form metadata, as a JSON object set with jsonencode(). Values Streamtime adds are not shown as changes.optimization_goal(String) What the cluster’s sizing favours, for example throughput or latency.region(String) Region the cluster runs in, used to choose a fleet.retention_days(Number) Days messages are kept, when retention is finite.retention_mode(String) Finite or Infinite. Streamtime does not return it, so a change made outside Terraform is not shown.tags(Map of String) Tags on the cluster, as key = value. Removing the attribute keeps the current tags; set tags = {} to clear them.tenancy_mode(String) Shared, Isolated or Dedicated.timeouts(Attributes) (see below for nested schema)
Read-Only
configuration_state(String) Whether the cluster’s settings are complete: incomplete, valid or invalid.generation(Number) Version of the cluster’s settings; it goes up when they change.id(String) Same as identifier. Use the identifier to import.observed_generation(Number) Version of the settings the running cluster has.reconciliation_state(String) Progress of the last change: pending, queued, running, succeeded or failed.spec(String) What Streamtime reports about the running cluster (bootstrap servers, listeners, version), as JSON. Read it with jsondecode().status(String) Health of the cluster, for example Provisioning, Healthy or Error.
Nested Schema for timeouts
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as “30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Import by identifier.
terraform import streamtime_kafka.orders orders