Skip to main content
Manages a Kosli flow. A flow represents a business or software process that requires change tracking. It lets you monitor changes across all steps within a process or focus on a subset of critical steps.
The template attribute accepts a YAML string defining the flow template structure. You can load it from a file using the file() function: template = file("template.yml"). Minor YAML formatting differences between what you provide and what the API returns may result in a no-op change being shown in plans.

Example usage

terraform {
  required_providers {
    kosli = {
      source = "kosli-dev/kosli"
    }
  }
}

# Minimal flow with only a name
resource "kosli_flow" "minimal" {
  name = "my-service"
}

# Flow with description
resource "kosli_flow" "with_description" {
  name        = "api-service"
  description = "CD pipeline for the API service"
}

# Flow with a YAML template defining trails and attestations
# The template can also be loaded from a file: template = file("template.yml")
resource "kosli_flow" "with_template" {
  name        = "backend-service"
  description = "Backend service CD pipeline with full attestation template"

  template = <<-YAML
version: 1
trail:
  attestations:
    - name: pull-request
      type: pull_request
    - name: unit-tests
      type: generic
  artifacts:
    - name: docker-image
      attestations:
        - name: sbom
          type: generic
        - name: security-scan
          type: snyk
YAML
}

Import

Flows can be imported using their name:
terraform import kosli_flow.example my-flow-name

Schema

Required

  • name (String) Name of the flow. Must be unique within the organization. Changing this will force recreation of the resource.

Optional

  • description (String) Description of the flow. Explains the purpose and context of this pipeline.
  • template (String) YAML template defining the flow structure (trails, artifacts, attestations). Can be provided as an inline heredoc or loaded from a file using file(). If omitted, the flow is created without a template.
Last modified on April 9, 2026