KOP Environment Manager - Selectors - Rafay Product Documentation

Selectors

Overview

Selectors provide a powerful mechanism to target and customize specific environment variables within Environment Templates and Resource Templates. They address scenarios where multiple variables with the same name exist, enabling precise overrides and better variable management.

Key benefits of selectors include:

When defined, selectors act as an alias in the Environment Template, Resource Template, and environment publishing pages, while the actual variable name used in activities is specified within the selector. Selectors also support wildcard matching for more dynamic targeting.

How Selectors Work


Examples of Selector Usage

Below are some of the significant examples that can help users effectively target and manage variables within Resource Templates and Environment Templates.

Selectors Valid at Resource Template Level

hook.<oninit/onsuccess/onfailure/oncompletion>.<hook_name>.<variable_name>
hook.*.<hook_name>.<variable_name>
hook.oninit.*.<variable_name>
provider.hook.<deploy/destroy>.<init/plan/apply/output/destroy>.<before/after>.<hook_name>.<var_name>
artifact.<variable_name>
provider.lifecycle.<init/plan/apply/output/destroy>.<var_name>
provider.task.<task-name>.<var-name>

Selectors Valid at Environment Template Level

resource.<resource_name>.<variable_or_alias_name>
resource.*.<variable_or_alias_name>
environment.hook.<oninit/onsuccess/onfailure/oncompletion>.<hook_name>.<variable_name>
resource.<resource_name>.[any-selector-that's-valid-at-RT-level]

Back to top