LogoLogo
HomeBlogGet a Demo
  • Introduction
  • Install Lunar
  • Learn the basics
  • 📖Docs
    • Key concepts
    • Component JSON
    • Catalog JSON
    • Lunar CLI Reference
  • 📝Configuration
    • lunar-config.yml
      • catalogers
      • catalogers/hooks
      • domains
      • components
      • collectors
      • collectors/hooks
      • policies
    • lunar.yml
  • 🛠️Plugin SDKs
    • Plugins configuration
      • lunar-cataloger.yml
      • lunar-collector.yml
      • lunar-policy.yml
    • Bash SDK
      • Cataloger
      • Collector
    • Python SDK
      • Collector
      • Policy
        • Check
        • Path
        • ComponentData
        • NoDataError
        • Utility Functions
  • ⚙️SQL API
    • Overview
    • Views
      • domains
      • components
      • component_deltas
      • initiatives
      • policies
      • checks
      • prs
      • catalog
Powered by GitBook

©️ Earthly Technologies

On this page
  • Policy Plugin
  • version
  • name
  • description
  • author
  • policies
  • inputs
  1. Plugin SDKs
  2. Plugins configuration

lunar-policy.yml

Policy Plugin

  • lunar-policy.yml

  • Type: YAML file

  • Form:

    version: 0
    
    name: <policy-name>
    description: <policy-description>
    author: <author-name>
    
    policies:
      - <policy-configuration>
      - <policy-configuration>
      - ...
    
    inputs:
      <input-name>:
        description: <input-description>
        default: <default-value>
      ...

This page describes the configuration of a policy plugin. Policy plugins are used to define the rules that Lunar uses to evaluate the health of components. Policy plugins can be imported from the Lunar configuration file, lunar-config.yml via the uses policy form.

Policy plugins can be defined either in a separate repository or in the same repository as the Lunar configuration, in a dedicated directory. Either way, the policy plugin must contain a lunar-policy.yml file in the root of the repository or directory. This file is used to configure the behavior of the policy plugin.

When using policies in the Main or Run forms (e.g. mainPython or runPython), the policy plugin directory may also contain an install.sh file, and/or a requirements.txt file. These files can be used to specify any environment setup logic to be executed, or Python dependencies to be installed, respectively, before executing the main script. In ephemeral environments, the installation is executed every time the environment is created (e.g. on each policy run). Lunar uses a lock file under the hood to detect if the script has previously been executed.

version

  • lunar-policy.yml -> version

  • Type: numeric

  • Required

The version field is used to specify the version of the policy configuration file. The current version is 0.

name

  • lunar-policy.yml -> name

  • Type: string

  • Required

The name field is used to specify the name of the policy.

description

  • lunar-policy.yml -> description

  • Type: string

  • Optional

The description field is used to specify a description of the policy.

author

  • lunar-policy.yml -> author

  • Type: string

  • Required

The author field is used to specify the author of the policy.

policies

  • lunar-policy.yml -> policies

  • Type: array

  • Required

inputs

  • lunar-policy.yml -> inputs

  • Type: object

  • Optional

The inputs field is used to specify the inputs that the policy requires. Each input is defined as a key-value pair, where the key is the input name.

Inputs are passed to the policy when invoked in the form of environment variables.

description

  • lunar-policy.yml -> inputs.<input-name>.description

  • Type: string

  • Optional

The description field is used to specify a description of the input.

default

  • lunar-policy.yml -> inputs.<input-name>.default

  • Type: string

  • Optional

The default field is used to specify the default value of the input. If no default value is specified, the input is required.

Previouslunar-collector.ymlNextBash SDK

Last updated 2 months ago

The policies field is used to specify the configuration of the policy. The format of a policy is the same as in lunar-config.yml, except that the on and level fields are not allowed (these are configured in lunar-config.yml only). To learn more about the configuration of a policy, see the page.

🛠️
policies