> For the complete documentation index, see [llms.txt](https://docs-lunar.earthly.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-lunar.earthly.dev/configuration/lunar-config/domains.md).

# domains

Define the domains section of lunar-config.yml — hierarchical groupings that organize related components for ownership and policy targeting.

* `lunar-config.yml -> domains`
* Type: `object`
* Form:

  ```yaml
  domains:
    <domain-path>: <domain-object>
    <domain-path>: <domain-object>
    ...
  ```

Domains are used to group related components together. Domains are hierarchical and can contain other domains.

A domain's path is a string that uniquely identifies the domain. If a domain `bar` is within the domain `foo`, then the domain path is `foo.bar`.

Components under a domain receive the special tag `domain:<domain-name>` automatically. For example, components in the domain `foo.bar` will receive the tag `domain:foo.bar`. This tag can be used in [tag matching expressions](https://docs-lunar.earthly.dev/configuration/lunar-config/on.md) to target components by domain.

Example domains defintion:

{% code title="lunar-config.yml" %}

```yaml
domains:
  saas-product:
    description: Acme's SaaS product
    owner: roberto@example.com
  saas-product.frontend:
    description: The frontend of Acme's SaaS product
    owner: jacqueline@example.com
  saas-product.frontend.ui-components:
    description: Common UI components for the frontend
    owner: jill@example.com
  saas-product.frontend.ui-common:
    description: Common UI code for the frontend
    owner: jane@example.com
  saas-product.frontend.ui-dashboard:
    description: The dashboard for the frontend
    owner: mary@example.com
  saas-product.frontend.ui-login:
    description: The login page for the frontend
    owner: jessica@example.com
  saas-product.backend:
    description: The backend of Acme's SaaS product
    owner: john@example.com
  saas-product.backend.auth:
    description: The authentication service for the backend
    owner: jesse@example.com
  saas-product.backend.rev-proxy:
    description: The reverse proxy for the backend
    owner: mike@example.com
  saas-product.backend.gateway:
    description: The gateway for the backend
    owner: larry@example.com
  widget-product:
    description: Acme's widget product
    owner: noah@example.com
  widget-product.frontend:
    description: The frontend of Acme's widget product
    owner: corey@example.com
  widget-product.data-processing:
    description: Data processing for Acme's widget product
    owner: ann@example.com
  common-infra:
    description: Common infrastructure
    owner: alice@example.com
    meta: # 🚧 Coming Soon
      "okta-team": "infra"
  common-infra.monitoring:
    description: Monitoring for common infrastructure
    owner: bob@example.com
  common-infra.logging:
    description: Logging for common infrastructure
    owner: todd@example.com
```

{% endcode %}

Domains are associated with components using the `domain` field in the [component definition](https://docs-lunar.earthly.dev/configuration/lunar-config/components.md).

## Domain

* `lunar-config.yml -> domains.<domain-path>`
* Type: `object`
* Form:

  ```yaml
  description: <description>
  owner: <email>
  meta:                          # 🚧 Coming Soon
    <meta-key>: <meta-value>
    <meta-key>: <meta-value>
    ...
  ```

A domain is a group of related components. Domains are hierarchical and can contain other domains.

### `description`

* `lunar-config.yml -> domains.<domain-path>.description`
* Type: `string`
* Optional

A description of the domain.

### `owner`

* `lunar-config.yml -> domains.<domain-path>.owner`
* Type: `string`
* Optional

The email address of the owner of the domain.

### `meta` 🚧 Coming Soon

* `lunar-config.yml -> domains.<domain-path>.meta`
* Type: `object`
* Optional

A key-value store of arbitrary metadata for the domain. This metadata is not used by Lunar, but can be used by collectors and policies.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs-lunar.earthly.dev/configuration/lunar-config/domains.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
