Skip to main content

Operations

Welcome to the heart of the Compliance Engine—its operations. Operations are the declarative building blocks you will use in logic.yaml files to define how the engine evaluates your cloud resources. They are designed to be expressive, readable, and powerful, enabling you to translate complex compliance requirements into clear, maintainable logic.

This documentation is structured to help you quickly find the information you need. Below, you will find a categorized list of all available operations. Each operation links to a dedicated page with detailed syntax, examples, and direct links to its unit tests.

Foundational Concepts

Before diving into specific operations, it is highly recommended to understand the two core concepts that underpin all policy logic:

  • The Type System: The Compliance Engine uses a specialized set of data types (Text, Bytes, Number, Set, etc.). Understanding their unique behaviors—especially how they handle comparisons, case sensitivity, and empty values—is essential for writing accurate policies.
  • Object Relationships: Policies often need to evaluate data from related resources (e.g., checking the rules of a security group attached to an instance). This guide explains how to navigate these connections using lookup fields and related lists.

Operations Quick Reference

Operations are grouped by their primary function to help you find the right tool for the job.

Operation NameReturn Type(s)Description
Data Access
FIELDText, Bytes, Number, DateTimeAccesses a raw field value from a CMDB object. Best used during development or within extracts.
EXTRACTAnyRetrieves a pre-defined, safe-to-use value via a reusable extract. Recommended for production logic.
Lookup Validation
IS_EMPTY_LOOKUPBooleanChecks if a lookup relationship path is broken or incomplete.
NOT_EMPTY_LOOKUPBooleanEnsures a lookup relationship path is fully resolved.
Constants
TEXTTextCreates a case-insensitive, whitespace-normalized text constant.
BYTESBytesCreates a case-sensitive, whitespace-preserving text constant.
BOOLEANBooleanCreates a true or false constant.
NUMBERNumberCreates a numeric constant (integer or decimal).
DATE_TIMEDateTimeCreates a specific date-time constant.
LISTListCreates an ordered collection that allows duplicates.
SETSetCreates an unordered collection of unique items.
JSONJsonCreates a JSON object constant from YAML.
Type Conversions
BOOLEAN_FROMBooleanConverts a string (e.g., "true", "yes", "enabled") into a boolean.
DATE_TIME_FROMDateTimeParses a string into a DateTime object.
DURATION_FROMDurationParses a string into a Duration object.
LIST_FROMListSplits a string into an ordered List.
SET_FROMSetSplits a string into an unordered Set of unique items.
JSON_FROMJsonParses a JSON-formatted string into a queryable Json object.
Simple Comparison
IS_EMPTYBooleanChecks if a value is empty, null, or whitespace-only.
NOT_EMPTYBooleanChecks if a value is not empty.
IS_EQUALBooleanPerforms a deep equality check between two values of the same type.
NOT_EQUALBooleanChecks if two values are not equal.
Logical Operators
ANDBooleanReturns true if all arguments are true.
ORBooleanReturns true if at least one argument is true.
NOTBooleanInverts a boolean value.
Search & Substring
CONTAINSBooleanChecks if a string contains a substring or a collection contains an element.
CONTAINS_ALLBooleanChecks if a target contains all items from a given collection.
CONTAINS_ANYBooleanChecks if a target contains at least one item from a given collection.
STARTS_WITHBooleanChecks if a string or list starts with a specific value.
ENDS_WITHBooleanChecks if a string or list ends with a specific value.
Numerical Comparison
GREATER_THANBooleanleft > right
GREATER_THAN_EQUALBooleanleft >= right
LESS_THANBooleanleft < right
LESS_THAN_EQUALBooleanleft <= right
Date & Time
IS_BEFORE_TODAYBooleanChecks if a date is in the past.
IS_AFTER_TODAYBooleanChecks if a date is in the future.
IS_BEYOND_LAST_DAYSBooleanChecks if a date is older than N days ago.
IS_BEYOND_NEXT_DAYSBooleanChecks if a date is further out than N days from now.
IS_WITHIN_LAST_DAYSBooleanChecks if a date falls within the last N days.
IS_WITHIN_NEXT_DAYSBooleanChecks if a date falls within the next N days.
Collection Operations
SIZENumberReturns the number of items in a List or Set.
JSON Operations
JSON_QUERY_TEXTTextExtracts a Text value from a Json object using a JMESPath query.
JSON_QUERY_BYTESBytesExtracts a Bytes value from a Json object.
JSON_QUERY_BOOLEANBooleanExtracts a Boolean value from a Json object.
JSON_QUERY_NUMBERNumberExtracts a Number value from a Json object.
Tag Operations
TAG_EXISTSBooleanChecks if a tag with a specific name exists.
TAG_VALUE_TEXTTextRetrieves a tag's value as a case-insensitive Text.
TAG_VALUE_BYTESBytesRetrieves a tag's value as a case-sensitive Bytes.
Related List Aggregates
RELATED_LIST_HASBooleanChecks if a related list has at least one item with a specific status.
RELATED_LIST_HAS_NOBooleanChecks if a related list has no items with a specific status.
RELATED_LIST_COUNTNumberCounts the number of related items with a specific status.
Provider-Specific
AWS_POLICY_ALLOWSBooleanChecks if an AWS IAM policy allows a set of actions at a given access level.
GCP_LOGGING_QUERY_MATCHBooleanChecks if a GCP Logging query matches another.
Special & Development
IS_DISAPPEAREDBooleanChecks if an object has been marked as disappeared from the source.
DEBUGAnyPrints the value of an operation during execution for debugging.
UNIT_TESTBooleanDefines a unit test case within a logic file.
UNIT_TEST_NULLAnyGenerates a null value of a specific type for testing.
UNIT_TEST_RUNTIME_ERRORAnySimulates a runtime error for testing failure scenarios.