streamtime_flink (Resource)

A Flink instance on a fleet: a single-job cluster that runs one application, or a job workspace that runs several jobs. Creating one deploys it and waits until it is ready; a change is deployed and waited for too. If a change fails to deploy, the next plan shows it as an update and that apply deploys it again.

Example Usage

# A single-job Flink cluster that runs a version of a Flink project.
# Apply waits until it is ready, and until a change is running.
resource "streamtime_flink" "etl" {
  identifier  = "etl"
  mode        = "application"
  fleet       = streamtime_fleet.byok.identifier
  flink_units = 2

  project_version = {
    project = streamtime_flink_project.etl.identifier
    version = "1.0.0"
  }

  # Parallelism, resources and Flink settings.
  advanced_configuration = jsonencode({
    parallelism = 2
  })

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

output "flink_ui" {
  value = streamtime_flink.etl.ui_url
}

Schema

Required

  • identifier (String) Unique name of the instance: up to 24 lowercase letters, digits and dashes. Changing it creates a new instance.
  • mode (String) application (a single-job cluster that runs one application) or session (a job workspace that runs several jobs). Changing it creates a new instance.

Optional

  • advanced_configuration (String, Sensitive) Advanced settings, as a JSON object set with jsonencode(): the application, image, runtime of a job workspace (java or python), parallelism, resources and Flink settings. It may include a license key. Settings Streamtime fills in are not shown as changes.
  • description (String) Free-text description.
  • fleet (String) Identifier of the fleet to deploy on. Leave it out to let Streamtime choose a fleet. Changing it creates a new instance.
  • flink_provider (String) Flink distribution: open-source (the default) or cmf (Confluent Manager for Apache Flink). Changing it creates a new instance.
  • flink_units (Number) Capacity of a single-job cluster (mode = application), in Flink units.
  • max_flink_units (Number) Capacity a job workspace (mode = session) shares between its jobs, in Flink units.
  • project_version (Attributes) Version of a Flink project to run, instead of an application location in advanced_configuration. (see below for nested schema)
  • tags (Map of String) Tags on the instance, as key = value. Removing the attribute keeps the current tags; set tags = {} to clear them.
  • timeouts (Attributes) (see below for nested schema)

Read-Only

  • configuration_state (String) Whether the instance’s settings are complete: incomplete, valid or invalid.
  • generation (Number) Version of the instance’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 instance has.
  • reconciliation_state (String) Progress of the last change: pending, queued, running, succeeded or failed.
  • status (String) Health of the instance, for example Provisioning, Healthy or Error.
  • ui_url (String) Address of the Flink web UI, once the instance is ready.

Nested Schema for project_version

Required:

  • project (String) Identifier of the Flink project.
  • version (String) Version uploaded to that project.

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_flink.etl etl