# File Watcher Provisioning

Connections are defined in the **`provisioning.yaml`** file. Lenses will then watch the file and resolve the desired state, applying connections defined in the file.

{% hint style="danger" %}
If a connection is not defined but exists in Lenses it will be removed. It is very important to keep your provision YAML updated to reflect the desired state.
{% endhint %}

<figure><img src="/files/U1Qmn53LfvT0Xztdxbln" alt=""><figcaption></figcaption></figure>

## Enabling File Watcher Provisioning

File watcher provisioning must be explicitly enabled. Set the following in the **`lenses.conf`** file:

{% code title="lenses.conf" %}

```bash
# Directory containing the provision.yaml files
lenses.provisioning.path=/my/dir
# The interval at which Lenses will check for updates 
# in the file seconds
lenses.provisioning.interval=10s
```

{% endcode %}

{% hint style="success" %}
Updates to the file will be loaded and applied if valid without a restart of Lenses.
{% endhint %}

## Directory layout

Lenses expects a set of files in the directory, defined by **`lenses.provisioning.path`**. The structure of the directory must follow:

1. **files/** directory for storing any certificates, JKS files or other files needed by the connection
2. **provisioning.yaml** - This is the main file, holding the definition of the connections
3. **license.json** - Your lenses license file

```bash
➜  ~ tree provisioning-folder
provisioning-folder
├── files
│   └── tuststore.jks
├── license.json
└── provisioning.yaml

4 directories, 0 files
➜  ~
```

## Managing secrets

The **`provisioning.yaml`** contains secrets. If you are deploying via Helm, the chart will use Kubernetes secrets.

Additionally, support is provided for referencing environment variables. This allows you to set secrets in your environment and have the value resolved at runtime.

{% code title="values.yaml" %}

```yaml
sslKeystorePassword:
  value: ${ENV_VAR_NAME}
```

{% endcode %}

## Referencing files

Many connections need files, for example, to secure Kafka with SSL you will need a **`key store`** and optionally a **`trust store`**.

To reference a file in the **`provisioning.yaml`**, for example, given:

{% code title="values.yaml" %}

```yaml
    configuration:
      protocol:
        value: SASL_SSL
      sslKeystore:
        file: "my-keystore.jks"
```

{% endcode %}

a **file** called **`my-keystore.jks`** is expected in the files directory. This file will be used for the key store location.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lenses.io/latest/devx/5.5/deployment/installation/automation/file-watcher-provisioning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
