streamtime_virtual_kafka (Resource)

A virtual Kafka cluster: its own endpoint and sign-in for a share of a Kafka cluster’s capacity. Creating one deploys it and waits until it is ready. A change to its capacity or settings is deployed in place, and apply waits until it is running.

Example Usage

# A virtual Kafka cluster: its own endpoint and sign-in for a share of a Kafka cluster.
# Apply waits until it is ready, and a change to its capacity is deployed in place.
resource "streamtime_virtual_kafka" "team_a" {
  identifier  = "team-a"
  kafka_id    = streamtime_kafka.orders.identifier
  kafka_units = 1

  # The sign-in provider clients use.
  advanced_config = jsonencode({
    oauth = {
      client_id         = "team-a"
      client_secret     = var.oauth_client_secret
      issuer            = "https://login.example.com"
      jwks_endpoint     = "https://login.example.com/jwks"
      authorization_uri = "https://login.example.com/authorize"
      token_uri         = "https://login.example.com/token"
      audience          = "team-a"
    }
  })

  timeouts = {
    create = "60m"
    update = "60m"
    delete = "60m"
  }
}

output "virtual_kafka_endpoints" {
  value     = jsondecode(streamtime_virtual_kafka.team_a.resources).endpoints
  sensitive = true
}

Schema

Required

  • advanced_config (String, Sensitive) Advanced settings, as a JSON object set with jsonencode(). It must hold the sign-in provider (oauth) that clients use, including its client secret. Settings Streamtime fills in are not shown as changes.
  • identifier (String) Unique name: up to 24 lowercase letters, digits and dashes. Changing it creates a new virtual cluster.
  • kafka_id (String) Identifier of the Kafka cluster that provides the capacity. Changing it creates a new virtual cluster.
  • kafka_units (Number) Share of the Kafka cluster’s capacity, in capacity units. The shares of all virtual clusters on a Kafka cluster cannot add up to more than the cluster’s capacity.

Optional

Read-Only

  • configuration_state (String) Whether the settings are complete: incomplete, valid or invalid.
  • fetch_bytes_per_second (Number) Read limit in bytes per second, from kafka_units.
  • fleet (String) Identifier of the fleet the virtual cluster runs on: the fleet of its Kafka cluster.
  • generation (Number) Version of the settings; it goes up when they change.
  • id (String) Same as identifier. Use the identifier to import.
  • observed_generation (Number) Version of the settings that is running.
  • produce_bytes_per_second (Number) Write limit in bytes per second, from kafka_units.
  • reconciliation_state (String) Progress of the last change: pending, queued, running, succeeded or failed.
  • resources (String, Sensitive) Endpoints and ready-to-use client properties, as JSON, once the virtual cluster is healthy. Read it with jsondecode().
  • status (String) Health of the virtual 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.
  • update (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).

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Import by identifier.
terraform import streamtime_virtual_kafka.team_a team-a