# Event Stream Source YAML Reference


> Complete reference for defining Event Stream sources using YAML configuration files.



This guide serves as a detailed reference for the CLI project YAML files that contain definitions of your Event Stream source resources.

## Overview

In the context of the Rudder CLI (`rudder-cli`) tool, you can define Event Stream sources as YAML files within your project directory. The location and naming of these YAML files is flexible, as you can store the YAML files anywhere within the project's root directory or subdirectories.

**Info:** The Rudder CLI tool processes all valid YAML files within the project structure to recognize the defined resources.

## Event Stream Sources

You can define an Event Stream source in the YAML file by setting `kind` to `event-stream-source`.

The `spec` parameter of the YAML file has the following structure:

| Property | Type | <div>Description</div> |
| :----| :-----| :------|
| `id` <br/> Required | String | Unique identifier for the source within the project. This parameter must be unique across all sources in the project. |
| `type` <br/> Required | String | Source type identifier. See [Supported source types](#supported-source-types) for the list of acceptable values. |
| `name` <br/> Required | String | Name for the source. It must be non-empty. |
| `enabled` | Boolean | Determines whether this source is accepting events. <br /><br />**Default value**: `true` |
| `governance` | [Data governance configuration](#data-governance-configuration) object | Contains data governance-related settings for the source. |

### Data governance configuration

The `governance` object contains validation settings that control how the source handles any Tracking Plan violations:

| Property | Type | <div>Description</div> |
| :----| :-----| :------|
| `validations` <br/> Required | [Validation properties](#validation-properties) object | Contains validation configuration including Tracking Plan reference and violation rules. |

### Validation properties

The `validations` object contains the Tracking Plan reference and violation handling rules:

| Property | Type | <div>Description</div> |
| :----| :-----| :------|
| `tracking_plan` <br/> Required | String | URN reference to a Tracking Plan resource — the format is `#tracking-plan:[tracking-plan.id]`, where `tracking-plan.id` is the `spec.id` value of the Tracking Plan resource. |
| `config` | [Violation rules configuration](#violation-rules-configuration) object | Contains violation rules for all event types. If not specified, default violation rules apply to all event types. |

**Info**

You must have a [Tracking Plan defined in your CLI project](https://www.rudderstack.com/docs/rudder-cli/data-catalog-and-tracking-plans/tracking-plans/) before you can reference it in a source configuration.

See [CLI-based Tracking Plan Management](https://www.rudderstack.com/docs/rudder-cli/data-catalog-and-tracking-plans/tracking-plans/create/) for more information on creating Tracking Plans.

### Violation rules configuration

The `config` object contains violation handling rules for different event types. Each event type configuration is optional; if not specified, default violation rules apply:

| Property | Type | <div>Description</div> |
| :----| :-----| :------|
| `track` | [Violation rules](#violation-rules-properties) object | Violation rules for `track` events. |
| `identify` | [Violation rules](#violation-rules-properties) object | Violation rules for `identify` events. |
| `group` | [Violation rules](#violation-rules-properties) object | Violation rules for `group` events. |
| `page` | [Violation rules](#violation-rules-properties) object | Violation rules for `page` events. |
| `screen` | [Violation rules](#violation-rules-properties) object | Violation rules for `screen` events. |

### Violation rules properties

Each violation rules object contains the following properties:

| Property | Type | <div>Description</div> |
| :----| :-----| :------|
| `propagate_violations` | Boolean | Determines whether to add violations in event context. When enabled, violation information is included in the event payload's context for downstream processing. <br /><br />**Default value**: `true` |
| `drop_unplanned_events` | Boolean | **Only applies to `track` configuration.** Determines whether to drop events without a corresponding rule in the associated Tracking Plan. <br /><br />**Default value**: `false` |
| `drop_unplanned_properties` | Boolean | Determines whether to drop properties that are not defined in the Tracking Plan for the event. <br /><br />**Default value**: `false` |
| `drop_other_violations` | Boolean | Determines whether to drop events with any other validation violations. <br /><br />**Default value**: `false` |

**Warning**

If you set `drop_unplanned_events`, `drop_unplanned_properties`, or `drop_other_violations` to `true`, events that violate these rules are dropped and not forwarded to destinations.

Make sure you understand the impact of these settings before deploying your source configuration.

### Validation rules

<div class="vr-explorer vr-explorer--filtered" data-vr-explorer data-vr-instance="1">
<div class="vr-explorer__toolbar">
<div class="vr-explorer__toolbar-row">
<div class="vr-explorer__search-wrap">
<label class="vr-explorer__search-label" for="vr-rules-search-1">Search rules</label>
<input id="vr-rules-search-1" class="vr-explorer__search" type="search" placeholder="Search rules…" data-vr-search autocomplete="off">
</div>
<div class="vr-explorer__spec-wrap">
Spec version
<div class="vr-explorer__spec-toggle">
<button type="button" class="vr-explorer__spec-btn is-active" data-vr-spec="v1">v1</button>
<button type="button" class="vr-explorer__spec-btn" data-vr-spec="legacy">v0.1</button>
</div>
</div>
</div>
<div class="vr-explorer__toolbar-row vr-explorer__toolbar-row--filters">
<div class="vr-explorer__phase">
Filter by phase
<button type="button" class="vr-explorer__phase-btn is-active" data-vr-phase="all">All</button>
<button type="button" class="vr-explorer__phase-btn" data-vr-phase="syntactic">Syntactic</button>
<button type="button" class="vr-explorer__phase-btn" data-vr-phase="semantic">Semantic</button>
</div>
<p class="vr-explorer__count" data-vr-count data-vr-total="5">Showing <strong>5</strong> of 5 rules</p>
</div>
</div>
<div class="vr-explorer__rules"><div class="vr-rule" id="vr-rule-1-event-stream-source-semantic-valid-v1" data-vr-rule data-phase="semantic" data-spec-version="v1" data-section="filtered-1" data-search="event-stream/source/semantic-valid event stream source references must resolve to existing resources semantic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">Event Stream source references must resolve to existing resources</h4>
<div class="vr-rule__meta">
semantic
error</div>
<p class="vr-rule__id">Rule ID: <code>event-stream/source/semantic-valid</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1-valid">

✓
Valid (2 examples)

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1-invalid">

✕
Invalid (3 examples)

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid source without governance</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My Python Source
  type: python</code></pre></div>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid source with an existing Tracking Plan reference</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My Python Source
  type: python
  governance:
    validations:
      tracking_plan: &#34;#tracking-plan:tp-main&#34;
      config: {}</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
tracking_plan.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: tracking-plan
metadata:
  name: tp-main
spec:
  id: tp-main
  name: Main Tracking Plan
  description: Default plan
  rules: []</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-event-stream-source-semantic-valid-v1-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">v1 source references a missing Tracking Plan</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My Python Source
  type: python
  governance:
    validations:
      tracking_plan: &#34;#tracking-plan:tp-missing&#34;
      config: {}</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/governance/validations/tracking_plan</code>
not found in the project
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">v1 source name duplicates another source in the project</h4><div class="rs-code">
<div class="rs-code__head">
source-a.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: source-a
spec:
  id: src-a
  name: Shared Name
  type: javascript</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
source-b.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: source-b
spec:
  id: src-b
  name: Shared Name
  type: node</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
source-a.yaml
<code class="vr-diagnostics__ref">/name</code>
duplicate name &#39;Shared Name&#39; within kind &#39;event-stream-source&#39;
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">V1 sources whose names differ only in case (names compare case-insensitively)</h4><div class="rs-code">
<div class="rs-code__head">
source-a.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: source-a
spec:
  id: src-a
  name: Web App
  type: javascript</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
source-b.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: source-b
spec:
  id: src-b
  name: web app
  type: node</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
source-a.yaml
<code class="vr-diagnostics__ref">/name</code>
duplicate name &#39;Web App&#39; (case-insensitive match with &#39;web app&#39;) within kind &#39;event-stream-source&#39;
</li><li class="vr-diagnostics__item">
source-b.yaml
<code class="vr-diagnostics__ref">/name</code>
duplicate name &#39;web app&#39; (case-insensitive match with &#39;Web App&#39;) within kind &#39;event-stream-source&#39;
</li></ul>
</div></div></div>
</div></div></div>
<div class="vr-rule" id="vr-rule-1-event-stream-source-semantic-valid-legacy" data-vr-rule data-phase="semantic" data-spec-version="legacy" data-section="filtered-1" data-search="event-stream/source/semantic-valid event stream source references must resolve to existing resources semantic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">Event Stream source references must resolve to existing resources</h4>
<div class="vr-rule__meta">
semantic
error</div>
<p class="vr-rule__id">Rule ID: <code>event-stream/source/semantic-valid</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy-valid">

✓
Valid (2 examples)

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy-invalid">

✕
Invalid (2 examples)

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid legacy source without governance</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My JavaScript Source
  type: javascript</code></pre></div>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid legacy source with an existing Tracking Plan reference</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My JavaScript Source
  type: javascript
  governance:
    validations:
      tracking_plan: &#34;#/tp/my-group/tp-main&#34;
      config: {}</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
tracking_plan.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: tracking-plan
metadata:
  name: tp-main
spec:
  id: tp-main
  name: Main Tracking Plan
  description: Default plan
  rules: []</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-event-stream-source-semantic-valid-legacy-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Legacy source references a missing Tracking Plan</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My JavaScript Source
  type: javascript
  governance:
    validations:
      tracking_plan: &#34;#/tp/my-group/tp-missing&#34;
      config: {}</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/governance/validations/tracking_plan</code>
not found in the project
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Legacy source name duplicates another source in the project</h4><div class="rs-code">
<div class="rs-code__head">
source-a.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: source-a
spec:
  id: src-a
  name: Shared Name
  type: javascript</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
source-b.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: source-b
spec:
  id: src-b
  name: Shared Name
  type: node</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
source-a.yaml
<code class="vr-diagnostics__ref">/name</code>
duplicate name &#39;Shared Name&#39; within kind &#39;event-stream-source&#39;
</li></ul>
</div></div></div>
</div></div></div>
<div class="vr-rule" id="vr-rule-1-event-stream-source-spec-syntax-valid-v1" data-vr-rule data-phase="syntactic" data-spec-version="v1" data-section="filtered-1" data-search="event-stream/source/spec-syntax-valid event stream source spec syntax must be valid syntactic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">Event Stream source spec syntax must be valid</h4>
<div class="vr-rule__meta">
syntactic
error</div>
<p class="vr-rule__id">Rule ID: <code>event-stream/source/spec-syntax-valid</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1-valid">

✓
Valid (2 examples)

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1-invalid">

✕
Invalid (2 examples)

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid source spec with required fields</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-python-source
spec:
  id: src-py-1
  name: My Python Source
  type: python</code></pre></div>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid source spec with Tracking Plan governance</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-android-source
spec:
  id: src-android-1
  name: My Android Source
  type: android
  governance:
    validations:
      tracking_plan: &#34;#tracking-plan:tp-main&#34;
      config: {}</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-v1-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">v1 source spec missing required name</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  type: javascript</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/name</code>
&#39;name&#39; is required
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">v1 source spec with legacy Tracking Plan reference format</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My Source
  type: javascript
  governance:
    validations:
      tracking_plan: &#34;#/tp/my-group/tp-1&#34;
      config: {}</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/governance/validations/tracking_plan</code>
&#39;tracking_plan&#39; is invalid: must be of pattern #tracking-plan:&lt;id&gt;
</li></ul>
</div></div></div>
</div></div></div>
<div class="vr-rule" id="vr-rule-1-event-stream-source-spec-syntax-valid-legacy" data-vr-rule data-phase="syntactic" data-spec-version="legacy" data-section="filtered-1" data-search="event-stream/source/spec-syntax-valid event stream source spec syntax must be valid syntactic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">Event Stream source spec syntax must be valid</h4>
<div class="vr-rule__meta">
syntactic
error</div>
<p class="vr-rule__id">Rule ID: <code>event-stream/source/spec-syntax-valid</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy-valid">

✓
Valid (2 examples)

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy-invalid">

✕
Invalid (3 examples)

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid legacy source spec with required fields</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-js-source
spec:
  id: src-js-1
  name: My JavaScript Source
  type: javascript</code></pre></div>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Valid legacy source spec with Tracking Plan governance</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-node-source
spec:
  id: src-node-1
  name: My Node.js Source
  type: node
  governance:
    validations:
      tracking_plan: &#34;#/tp/my-group/tp-main&#34;
      config: {}</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-event-stream-source-spec-syntax-valid-legacy-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Legacy source spec missing required id</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-source
spec:
  name: My Source
  type: javascript</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/id</code>
&#39;id&#39; is required
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Legacy source spec with unsupported source type</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My Source
  type: unknown_sdk</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/type</code>
&#39;type&#39; must be one of
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Legacy source spec with invalid Tracking Plan reference format</h4><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: event-stream-source
metadata:
  name: my-source
spec:
  id: src-1
  name: My Source
  type: javascript
  governance:
    validations:
      tracking_plan: &#34;#tracking-plan:tp-1&#34;
      config: {}</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/governance/validations/tracking_plan</code>
&#39;tracking_plan&#39; is invalid: must be of pattern #/tp/&lt;group&gt;/&lt;id&gt;
</li></ul>
</div></div></div>
</div></div></div>
<div class="vr-rule" id="vr-rule-1-project-duplicate-urn-all" data-vr-rule data-phase="syntactic" data-spec-version="all" data-section="filtered-1" data-search="project/duplicate-urn urns must be unique across the project syntactic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">URNs must be unique across the project</h4>
<div class="vr-rule__meta">
syntactic
errorAll spec versions</div>
<p class="vr-rule__id">Rule ID: <code>project/duplicate-urn</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-project-duplicate-urn-all-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-project-duplicate-urn-all-valid">

✓
Valid

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-project-duplicate-urn-all-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-project-duplicate-urn-all-invalid">

✕
Invalid

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-project-duplicate-urn-all">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-project-duplicate-urn-all-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Distinct URNs across files</h4><p class="vr-example__desc">Each spec declares a different resource, so URNs do not collide.</p><div class="rs-code">
<div class="rs-code__head">
a.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: events-a
spec:
  events:
    - id: order_completed
      name: Order Completed</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
b.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: events-b
spec:
  events:
    - id: cart_viewed
      name: Cart Viewed</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-project-duplicate-urn-all-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Same URN declared in two files</h4><p class="vr-example__desc">Both files declare the same event ID, which resolves to one URN. The rule flags each occurrence.</p><div class="rs-code">
<div class="rs-code__head">
a.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: events-a
spec:
  events:
    - id: order_completed
      name: Order Completed</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
b.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: events-b
spec:
  events:
    - id: order_completed
      name: Order Completed (duplicate)</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
a.yaml
<code class="vr-diagnostics__ref">/spec/events/0/id</code>
duplicate URN &#39;event:order_completed&#39;
</li><li class="vr-diagnostics__item">
b.yaml
<code class="vr-diagnostics__ref">/spec/events/0/id</code>
duplicate URN &#39;event:order_completed&#39;
</li></ul>
</div></div></div>
</div></div></div>
<div class="vr-rule" id="vr-rule-1-project-manifest-inline-conflict-all" data-vr-rule data-phase="syntactic" data-spec-version="all" data-section="filtered-1" data-search="project/manifest-inline-conflict a (workspace_id, urn) must not be defined in both an import-manifest and inline metadata.import with differing remote_ids syntactic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">A (workspace_id, urn) must not be defined in both an import-manifest and inline metadata.import with differing remote_ids</h4>
<div class="vr-rule__meta">
syntactic
errorAll spec versions</div>
<p class="vr-rule__id">Rule ID: <code>project/manifest-inline-conflict</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-project-manifest-inline-conflict-all-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-project-manifest-inline-conflict-all-valid">

✓
Valid

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-project-manifest-inline-conflict-all-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-project-manifest-inline-conflict-all-invalid">

✕
Invalid (2 examples)

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-project-manifest-inline-conflict-all">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-project-manifest-inline-conflict-all-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Manifest and inline metadata import distinct resources</h4><p class="vr-example__desc">One resource is imported via the manifest, a different one via inline metadata. No URN appears in both, so the project is valid.</p><div class="rs-code">
<div class="rs-code__head">
events.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: events
  import:
    workspaces:
      - workspace_id: &#34;ws-1&#34;
        resources:
          - urn: &#34;event:cart_viewed&#34;
            remote_id: &#34;remote_b&#34;
spec:
  events:
    - id: order_completed
      name: Order Completed
    - id: cart_viewed
      name: Cart Viewed</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
import-manifest.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: import-manifest
metadata:
  name: import-manifest
spec:
  workspaces:
    - workspace_id: &#34;ws-1&#34;
      resources:
        - urn: &#34;event:order_completed&#34;
          remote_id: &#34;remote_a&#34;</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-project-manifest-inline-conflict-all-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Same URN imported by both a manifest and inline metadata</h4><p class="vr-example__desc">The URN event:order_completed is declared in both the manifest and an inline metadata.import block — an ambiguous double import. The rule flags both locations; remove one.</p><div class="rs-code">
<div class="rs-code__head">
events.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: events
  import:
    workspaces:
      - workspace_id: &#34;ws-1&#34;
        resources:
          - urn: &#34;event:order_completed&#34;
            remote_id: &#34;remote_b&#34;
spec:
  events:
    - id: order_completed
      name: Order Completed</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
import-manifest.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: import-manifest
metadata:
  name: import-manifest
spec:
  workspaces:
    - workspace_id: &#34;ws-1&#34;
      resources:
        - urn: &#34;event:order_completed&#34;
          remote_id: &#34;remote_a&#34;</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
import-manifest.yaml
<code class="vr-diagnostics__ref">/spec/workspaces/0/resources/0/urn</code>
URN &#39;event:order_completed&#39; is defined in both an import-manifest and inline metadata
</li><li class="vr-diagnostics__item">
events.yaml
<code class="vr-diagnostics__ref">/metadata/import/workspaces/0/resources/0/urn</code>
URN &#39;event:order_completed&#39; is defined in both an import-manifest and inline metadata
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Manifest URN overlaps a legacy rudder/0.1 inline local_id import</h4><p class="vr-example__desc">The events spec uses the legacy rudder/0.1 format, whose inline imports reference resources by local_id &#43; remote_id. The local_id order_completed resolves to the URN event:order_completed — the same URN the manifest imports. Legacy specs are still subject to the conflict rule, so both locations are flagged; remove the inline metadata entry.</p><div class="rs-code">
<div class="rs-code__head">
events.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/0.1
kind: events
metadata:
  name: events
  import:
    workspaces:
      - workspace_id: &#34;ws-1&#34;
        resources:
          - local_id: order_completed
            remote_id: &#34;remote_b&#34;
spec:
  events:
    - id: order_completed
      name: Order Completed</code></pre></div>
</div><div class="rs-code">
<div class="rs-code__head">
import-manifest.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: import-manifest
metadata:
  name: import-manifest
spec:
  workspaces:
    - workspace_id: &#34;ws-1&#34;
      resources:
        - urn: &#34;event:order_completed&#34;
          remote_id: &#34;remote_a&#34;</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
import-manifest.yaml
<code class="vr-diagnostics__ref">/spec/workspaces/0/resources/0/urn</code>
URN &#39;event:order_completed&#39; is defined in both an import-manifest and inline metadata
</li><li class="vr-diagnostics__item">
events.yaml
<code class="vr-diagnostics__ref">/metadata/import/workspaces/0/resources/0/urn</code>
URN &#39;event:order_completed&#39; is defined in both an import-manifest and inline metadata
</li></ul>
</div></div></div>
</div></div></div>
<div class="vr-rule" id="vr-rule-1-project-metadata-syntax-valid-all" data-vr-rule data-phase="syntactic" data-spec-version="all" data-section="filtered-1" data-search="project/metadata-syntax-valid metadata syntax must be valid syntactic">
<div class="vr-rule__head">
<h4 class="vr-rule__title">Metadata syntax must be valid</h4>
<div class="vr-rule__meta">
syntactic
errorAll spec versions</div>
<p class="vr-rule__id">Rule ID: <code>project/metadata-syntax-valid</code></p>
</div><div class="vr-examples vr-examples--full-border">
<h4 class="vr-examples__heading">Examples</h4><nav>
<div class="nav nav-tabs vr-examples__tabs">
<a class="nav-item nav-link active vr-examples__tab vr-examples__tab--valid" id="nav-vr-tab-vr-rule-1-project-metadata-syntax-valid-all-valid" data-toggle="tab" href="#vr-tab-vr-rule-1-project-metadata-syntax-valid-all-valid">

✓
Valid (2 examples)

</a>
<a class="nav-item nav-link vr-examples__tab vr-examples__tab--invalid" id="nav-vr-tab-vr-rule-1-project-metadata-syntax-valid-all-invalid" data-toggle="tab" href="#vr-tab-vr-rule-1-project-metadata-syntax-valid-all-invalid">

✕
Invalid (2 examples)

</a>
</div>
</nav>
<div class="tab-content vr-examples__panels" id="nav-tab-content-vr-tab-vr-rule-1-project-metadata-syntax-valid-all">
<div class="tab-pane fade show active vr-examples__panel vr-examples__panel--valid" id="vr-tab-vr-rule-1-project-metadata-syntax-valid-all-valid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Metadata with only the required name</h4><p class="vr-example__desc">Minimal valid metadata: a name only.</p><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: my-events
spec:
  events: []</code></pre></div>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Metadata with a well-formed import block</h4><p class="vr-example__desc">An import block where each workspace declares workspace_id and each resource references a URN in the spec body.</p><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: my-events
  import:
    workspaces:
      - workspace_id: ws-123
        resources:
          - urn: &#34;event:order_completed&#34;
            remote_id: ev-remote-456
spec:
  events:
    - id: order_completed
      name: Order Completed</code></pre></div>
</div></div></div>
<div class="tab-pane fade vr-examples__panel vr-examples__panel--invalid" id="vr-tab-vr-rule-1-project-metadata-syntax-valid-all-invalid"><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Metadata missing required name</h4><p class="vr-example__desc">Every spec metadata block must declare a name.</p><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  import:
    workspaces:
      - workspace_id: ws-123
spec:
  events: []</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/metadata/name</code>
&#39;name&#39; is required
</li></ul>
</div></div><div class="vr-example__item">
<h4 class="vr-examples__heading vr-examples__heading--example">Import workspace missing required workspace_id</h4><p class="vr-example__desc">Each import workspace entry must declare a workspace_id.</p><div class="rs-code">
<div class="rs-code__head">
spec.yaml
yaml
<button class="rs-code__copy" type="button">

Copy
</button>
</div>
<div class="highlight"><pre class="chroma"><code class="language-yaml" data-lang="yaml">version: rudder/v1
kind: events
metadata:
  name: my-events
  import:
    workspaces:
      - resources:
          - urn: &#34;event:order_completed&#34;
            remote_id: ev-remote-456
spec:
  events:
    - id: order_completed
      name: Order Completed</code></pre></div>
</div><div class="vr-diagnostics">
<div class="vr-diagnostics__label">Diagnostics</div>
<ul class="vr-diagnostics__list"><li class="vr-diagnostics__item">
spec.yaml
<code class="vr-diagnostics__ref">/metadata/import/workspaces/0/workspace_id</code>
&#39;workspace_id&#39; is required
</li></ul>
</div></div></div>
</div></div></div>
</div>
</div>

## Supported source types

The following table lists all supported source types and their corresponding `type` values:

| Source | `type` value |
|------------|-------------|
| Java | `java` |
| .NET | `dotnet` |
| PHP | `php` |
| Flutter | `flutter` |
| Cordova | `cordova` |
| Rust | `rust` |
| React Native | `react_native` |
| Python | `python` |
| iOS (Swift) | `ios_swift` |
| Android (Kotlin) | `android_kotlin` |
| iOS (Obj-C) | `ios` |
| Android (Java) | `android` |
| JavaScript | `javascript` |
| Go | `go` |
| Node | `node` |
| Ruby | `ruby` |
| Unity | `unity` |

## Examples

#### Basic source configuration

This example shows a minimal source configuration without governance settings:

```yaml
version: rudder/v1
kind: event-stream-source
metadata:
  name: ios-source
spec:
  id: "my-ios-source"
  type: "ios"
  name: "iOS Source"
  enabled: true
```

#### Source with governance configuration

This example shows a source with governance configuration that links to a Tracking Plan and defines violation rules for different event types:

```yaml
version: rudder/v1
kind: event-stream-source
metadata:
  name: ios-source
spec:
  id: "my-ios-source"
  type: "ios"
  name: "iOS Source"
  enabled: true
  governance:
    validations:
      tracking_plan: "#tracking-plan:ecommerce-tracking-plan"
      config:
        track:
          propagate_violations: true
          drop_unplanned_events: true
          drop_unplanned_properties: true
          drop_other_violations: true
        identify:
          propagate_violations: true
          drop_unplanned_properties: true
          drop_other_violations: true
        group:
          propagate_violations: true
          drop_unplanned_properties: true
          drop_other_violations: true
        page:
          propagate_violations: true
          drop_unplanned_properties: true
          drop_other_violations: true
        screen:
          propagate_violations: true
          drop_unplanned_properties: true
          drop_other_violations: true
```

#### Source with partial governance configuration

This example shows a source that only defines violation rules for `track` events, letting other event types use default rules:

```yaml
version: rudder/v1
kind: event-stream-source
metadata:
  name: web-source
spec:
  id: "my-web-source"
  type: "javascript"
  name: "Web Source"
  enabled: true
  governance:
    validations:
      tracking_plan: "#tracking-plan:web-tracking-plan"
      config:
        track:
          propagate_violations: false
          drop_unplanned_events: false
          drop_unplanned_properties: false
          drop_other_violations: false
```

#### Disabled source

This example shows a source that is disabled and does not accept events:

```yaml
version: rudder/v1
kind: event-stream-source
metadata:
  name: test-source
spec:
  id: "test-source"
  type: "python"
  name: "Test Source"
  enabled: false
```

## Reference Tracking Plans

When configuring data governance validation, you can reference [Tracking Plans](https://www.rudderstack.com/docs/rudder-cli/data-catalog-and-tracking-plans/tracking-plans/) using the following URN format:

```yaml
tracking_plan: "#tracking-plan:[tracking-plan.id]"
```

Where `tracking-plan.id` is the `spec.id` value of the Tracking Plan.

For example, if your Tracking Plan YAML file looks like this:

```yaml
version: rudder/v1
kind: tracking-plan
metadata:
  name: ecommerce-tracking-plan
spec:
  id: product-tracking-plan
  display_name: "Product Tracking Plan"
  # ... rest of the configuration
```

You would reference it in your source configuration as:

```yaml
tracking_plan: "#tracking-plan:product-tracking-plan"
```

## See more

- See [Manage Event Stream Sources using Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/event-stream-sources/) for feature overview, and the [Event Stream Sources walkthrough](https://www.rudderstack.com/docs/rudder-cli/event-stream-sources-walkthrough/) for step-by-step setup
- See [CLI-based Tracking Plan Management](https://www.rudderstack.com/docs/rudder-cli/data-catalog-and-tracking-plans/tracking-plans/) to create the Tracking Plans that you can reference in your Event Stream source configurations
- See [Data Catalog and Tracking Plans YAML Reference](https://www.rudderstack.com/docs/rudder-cli/yaml-data-catalog-and-tracking-plans/) for information about Tracking Plan YAML structure
- See [Manage Destinations using Rudder CLI](https://www.rudderstack.com/docs/rudder-cli/destinations/) and [Connection YAML Reference](https://www.rudderstack.com/docs/rudder-cli/yaml-connections/) to send events from this source to a destination

<br />

