Operations
Type System
Compliance Engine type system is tailored for declarative policy development. These types not always behave as their counterparts from common programming languages.
Text Type
The Text
type in the Compliance Engine is a fundamental type designed for handling string data. It simplifies comparisons by normalizing case and a wide range of whitespace characters—including spaces, tabs (\t
), newlines (\n
), and carriage returns (\r
)—making it ideal for scenarios where the general content of the text matters more than its exact formatting. Unlike the Bytes
type, which preserves precise string representations, the Text
type ensures that variations in case and whitespace do not impact equality or pattern matching operations.
Key Characteristics
- Case Insensitivity: All comparisons ignore case differences. For example,
"Hello"
is treated as equal to"hello"
. - Whitespace Normalization:
- Leading and trailing whitespace characters (spaces, tabs, newlines, carriage returns) are removed.
- Multiple consecutive whitespace characters (spaces, tabs, newlines, carriage returns) are collapsed into a single space.
- Examples of normalization:
" Hello World "
becomes"hello world"
."a\nb\tc\r d"
becomes"a b c d"
." aa bb cc "
becomes"aa bb cc"
.
- Text-Only: The
Text
type is limited to text data and does not support binary data.
Purpose
The Text
type is tailored for use cases where exact casing and whitespace formatting (including special characters like tabs and newlines) are not significant, such as:
- General Text Handling: Comparing or searching strings where case and extra whitespace should be ignored, like usernames, descriptions, or tags.
- User-Friendly Inputs: Managing fields where users might input data inconsistently in terms of case or spacing (e.g.,
"John Doe"
,"john doe"
, or"John\nDoe"
). - Simplified Matching: Enabling straightforward string matching in policies without needing to account for formatting variations caused by different whitespace characters.
When to Use Text
Type
Choose the Text
type when your policy requires string comparisons that are tolerant of differences in case and whitespace, including special characters like tabs, newlines, and carriage returns. For cases where exact string matching is essential—such as API keys, passwords, or encoded data—use the Bytes
type instead.
Examples
Here are practical examples demonstrating how the Text
type behaves in policy conditions, incorporating its normalization of special characters:
-
Case-Insensitive Matching with Newlines:
-
Field:
CA10__status__c
contains"Active\n"
. -
Operation:
IS_EQUAL:
left:
FIELD:
path: CA10__status__c
right:
TEXT: "active" -
Result:
true
because"Active\n"
normalizes to"active"
, ignoring case and the newline.
-
-
Whitespace Normalization with Tabs and Spaces:
-
Field:
CA10__name__c
contains" John\tDoe "
. -
Operation:
IS_EQUAL:
left:
FIELD:
path: CA10__name__c
right:
TEXT: "john doe" -
Result:
true
because leading/trailing spaces and tabs are trimmed, and internal tabs collapse to spaces.
-
-
Handling Multiple Spaces and Newlines:
-
Field:
CA10__description__c
contains"Hello World\n\nTest"
. -
Operation:
CONTAINS:
arg:
FIELD:
path: CA10__description__c
substring:
TEXT: "hello world test" -
Result:
true
because multiple spaces and newlines are collapsed into single spaces, normalizing to"hello world test"
.
-
-
Matching Strings with Mixed Whitespace:
-
Field:
CA10__config__c
contains"key=value\r\nsetting=enabled"
. -
Operation:
CONTAINS:
arg:
FIELD:
path: CA10__config__c
substring:
TEXT: "key=value setting=enabled" -
Result:
true
because\r\n
is normalized to a single space, aligning the strings for comparison.
-
Important Notes
- Normalization Impact: The normalization of case and whitespace may cause unexpected matches if exact string representation matters. For precise matching, use the
Bytes
type. - Not for Sensitive Data: Avoid the
Text
type for data where case or whitespace is significant, such as passwords, API keys, or encoded strings. - Null and Empty String Handling: Empty strings (
""
) and null values are treated as equivalent. In operations likeCONTAINS
, an empty or null string contains another empty or null string but not a non-empty string.
Relevant Unit Tests
To explore or validate the Text
type's behavior further, check these unit tests:
- Unit tests for
IS_EMPTY
operation on Text type - Unit tests for
IS_EQUAL
operation on Text type - Unit tests for
CONTAINS
operation on Text type - Unit tests for
STARTS_WITH
operation on Text type - Unit tests for
ENDS_WITH
operation on Text type
Bytes Type
The Bytes
type in the Compliance Engine is a specialized text type designed to preserve case sensitivity and retain all whitespace exactly as provided, without trimming or normalization. Unlike the standard Text
type, which may normalize case or whitespace for comparisons, the Bytes
type ensures that string values are treated precisely as they are entered. This makes it ideal for scenarios requiring exact string matching.
Key Characteristics
- Case Sensitivity: Uppercase and lowercase letters are treated as distinct (e.g.,
"Key"
and"key"
are different). - Whitespace Preservation: All spaces, tabs, and newlines are retained with no trimming or normalization (e.g.,
" hello "
keeps its leading and trailing spaces). - Text-Only: Despite its name, the
Bytes
type does not store or process binary data; it is strictly a text type with specific handling rules.
Purpose
The Bytes
type is intended for use cases where the exact representation of text matters, such as:
- Sensitive Identifiers: API keys, tokens, or other identifiers where case and whitespace are significant.
- Encoded Strings: Text-based encoded data (e.g., base64 strings) that must remain unaltered for accurate processing or comparison.
- Precise Configuration Values: Settings or strings where whitespace or case differences carry meaning.
When to Use Bytes
Type
Use the Bytes
type when your policy requires exact string comparisons without modifications to case or whitespace. For general text handling where normalization is acceptable, the Text
type is more appropriate.
Examples
-
Matching an API Key Exactly:
-
Field:
CA10__apiKey__c
contains"AbCdEf123"
. -
Operation:
IS_EQUAL:
left:
FIELD:
path: CA10__apiKey__c
right:
BYTES: "AbCdEf123" -
Result:
true
only if the field matches"AbCdEf123"
exactly, including case.
-
-
Checking Whitespace in a Configuration String:
-
Field:
CA10__configString__c
contains" indent: 4"
. -
Operation:
STARTS_WITH:
arg:
FIELD:
path: CA10__configString__c
prefix:
BYTES: " " -
Result:
true
because the string starts with exactly two spaces.
-
-
Comparing Encoded Data:
-
Field:
CA10__encodedData__c
contains"SGVsbG8="
. -
Operation:
IS_EQUAL:
left:
FIELD:
path: CA10__encodedData__c
right:
BYTES: "SGVsbG8=" -
Result:
true
if the field matches the base64 string exactly.
-
Important Notes
- Not for Binary Data: The
Bytes
type is not a container for binary data. The Cloudaware CMDB does not support binary storage, and this type is meant solely for text with precise handling. - Naming Clarification: The name "Bytes" reflects its focus on exactness (like raw bytes in some contexts), but it remains a text-based type in practice.
Relevant Unit Tests
To explore or validate the Bytes
type's behavior further, check these unit tests:
- Unit tests for
IS_EQUAL
operation on Bytes type - Unit tests for
IS_EMPTY
operation on Bytes type
Boolean Type
Boolean type values support following values: true
, false
, null
.
You can not create null
constants from BOOLEAN
operation.
Return value of FIELD
for Checkbox fields also does not return null
.
However null
can be returned by operations like JSON_QUERY_BOOLEAN
. And operation IS_EMPTY
will return true
only on null
value.
See unit tests for IS_EMPTY
.
IS_EQUAL
operation also considers null
as a distinct value, which is not equal neither to true
nor to false
.
See unit tests for IS_EQUAL
.
Number Type
Number type represents numeric values, including integers and decimal numbers. Key features:
- Supports both integer and decimal representations.
- Standard numeric equality comparison (e.g.,
10
is equal to10.0
). - Zero (
0
) is considered a valid Number value and is not empty. null
is considered an empty Number value.- Standard comparison operations like
GREATER_THAN
,LESS_THAN
, etc., work as expected for numeric values. - Operations involving
null
and Number type in comparisons (GREATER_THAN
,LESS_THAN
, etc.) will generally returnfalse
.
See more details in:
- Unit Tests for
IS_EQUAL
operation on Number type - Unit Tests for
IS_EMPTY
operation on Number type - Unit Tests for
GREATER_THAN
- Unit Tests for
GREATER_THAN_EQUAL
- Unit Tests for
LESS_THAN
- Unit Tests for
LESS_THAN_EQUAL
DateTime Type
DateTime type represents a specific point in time, combining both date and time components. Key features:
- Stores both date and time information with precision up to milliseconds.
- Timezone-aware. All DateTime values are stored and processed in UTC. When comparing DateTime values, timezones are normalized to UTC for accurate comparison.
null
is considered an empty DateTime value.- Standard comparison operations like
IS_EQUAL
,NOT_EQUAL
, work as expected for DateTime values. - Contrary to usual approach to DateTime operations (like in BigQuery), where there are
CURRENT_DATETIME
,DATETIME_ADD
,DATETIME_SUB
functions which work together with numeric comparisons like<
,<=
,<
,>=
, Compliance Engine's approach is to minimize nested function calls by expose operations that integrate reference to current date and time, shifts and comparisons in one operation.
See more details in:
- Unit Tests for
IS_EQUAL
operation on DateTime type - Unit Tests for
IS_EMPTY
operation on DateTime type - Unit Tests for
IS_AFTER_TODAY
- Unit Tests for
IS_BEFORE_TODAY
- Unit Tests for
IS_BEYOND_LAST_DAYS
- Unit Tests for
IS_BEYOND_NEXT_DAYS
- Unit Tests for
IS_WITHIN_LAST_DAYS
- Unit Tests for
IS_WITHIN_NEXT_DAYS
Duration Type
Duration type represents a span of time, expressed in days, hours, minutes, and seconds. Key features:
- Represents a time difference, not a specific point in time.
- Can represent durations of any length, from seconds to many years.
null
is considered an empty Duration value.- Durations are always positive. Negative durations are not supported.
Collection Type
The Collection Type represents an unordered collection of Text values. Key features:
- Order of the elements in a collection does not matter.
- Item type is always Text.
- No duplicate values allowed. Item comparison is based on
IS_EQUAL
operation for Text type. - Items considered empty by
IS_EMPTY
operation are not added to collection. null
and empty collections are considered equal byIS_EQUAL
and empty by theIS_EMPTY
operation.
See more details in:
- Unit Tests for
IS_EQUAL
operation on Collection type - Unit Tests for
IS_EMPTY
operation on Collection type - Unit Tests for
COLLECTION_SIZE
operation - Unit Tests for
COLLECTION_CONTAINS
operation - Unit Tests for
COLLECTION_FROM
operation
JSON Type
The JSON Type represents data in JavaScript Object Notation (JSON) format. This type is used to handle semi-structured data commonly returned by various APIs, especially in cloud environments. Key features:
- Handles JSON objects, arrays, and primitive values.
- Uses JMESPath queries for extracting specific data elements using operations like
JSON_QUERY_TEXT
,JSON_QUERY_BOOLEAN
, etc. - Simple comparison operations like
IS_EMPTY
orIS_EQUAL
are not supported for JSON type. Instead, use checks withinJSON_FROM
operation and query operations to extract simple types.
Relationships Between Objects
Compliance Engine represents your cloud resources as interconnected objects, mirroring how resources are linked in your cloud environment. Understanding these relationships is key to writing effective compliance policies.
Compliance Engine uses "lookup fields" to represent connections between resources, similar to relationships in databases. These lookups primarily define one-to-many relationships, meaning one resource (the 'parent') can be related to multiple other resources (the 'children'). For example:
- One AWS VPC (Virtual Private Cloud) can contain many AWS EC2 Instances.
- One Azure Key Vault can store multiple Azure Key Vault Secrets.
In these relationships, one object acts as the "parent" and the others as "children". Let's examine the fields involved in the relationship between an AWS EC2 Instance and an AWS VPC. The CA10__CaAwsInstance__c
object (representing an EC2 Instance) contains the following fields related to its VPC:
Field API Name in CA10__CaAwsInstance__c | Example Value | Description |
---|---|---|
CA10__vpcId__c | vpc-01234567 | Cloud-native ID of the related VPC. This is the identifier as known in AWS. |
CA10__vpc__c | 00190000000vpc1AAR | Salesforce ID of the related VPC object within Cloudaware CMDB. This is the unique identifier used internally by Compliance Engine. |
CA10__vpc__r | {"Id":"...", "Name":"..."} | Related VPC object. This field provides access to the entire VPC object and its fields, such as Id and Name . |
CA10__vpc__r.CA10__disappearanceTime__c | null or 2025-01-01T00:00:00.000Z | Deletion timestamp of the related VPC. If not null, it indicates the VPC has been deleted in AWS, even though the Instance object might still exist in CMDB. |
Conversely, the CA10__CaAwsVpc__c
object (representing an AWS VPC) provides access to a list of related EC2 Instances through a related list field:
Related List API Name in CA10__CaAwsVpc__c | Example Value | Description |
---|---|---|
CA10__AWS_EC2_Instances__r | [{"Id":"...", "Name":"..."}, ...] | List of related EC2 Instances contained within this VPC. This is accessed as a related list from the VPC object, not as a field on the Instance object itself. |
To illustrate how these fields work in practice, consider these example SOQL queries, used to retrieve data from Cloudaware CMDB. These queries are similar to how Compliance Engine accesses data internally.
Query 1 - Retrieving VPC details from an EC2 Instance:
SELECT Id, Name, CA10__vpcId__c, CA10__vpc__c, CA10__vpc__r.Id, CA10__vpc__r.Name
FROM CA10__CaAwsInstance__c
This query retrieves information about an EC2 Instance and its related VPC. The results demonstrate how the different fields are populated:
Id | Name | CA10__vpcId__c | CA10__vpc__c | CA10__vpc__r |
---|---|---|---|---|
0029000000inst1AAD | i-0011223344 | vpc-01234567 | 00190000000vpc1AAR | {"Id":"00190000000vpc1AAR", "Name":"vpc-01234567"} |
0029000000inst2AAB | i-4433221100 | vpc-01234567 | 00190000000vpc1AAR | {"Id":"00190000000vpc1AAR", "Name":"vpc-01234567"} |
As you can see, CA10__vpc__r
field returns an object containing fields of the related VPC object.
Query 2 - Retrieving EC2 Instances within a VPC:
SELECT Id, Name, (SELECT Id, Name FROM CA10__AWS_EC2_Instances__r)
FROM CA10__CaAwsVpc__c
Id | Name | CA10__AWS_EC2_Instances__r |
---|---|---|
00190000000vpc1AAR | vpc-01234567 | [{"Id":"0029000000inst1AAD", "Name":"i-0011223344"}, {"Id":"0029000000inst2AAB", "Name":"i-4433221100"}] |
Important Considerations for Policy Logic:
When writing policies, remember that these lookup fields can have different states, especially in a dynamic cloud environment:
CA10__vpcId__c | CA10__vpc__c | CA10__vpc__r.CA10__disappearanceTime__c | Scenario |
---|---|---|---|
Empty | Empty | Empty | No VPC Association: The EC2 Instance is not currently associated with any VPC. This might be valid in some cases, but often indicates a misconfiguration. |
vpc-01234567 | Empty | Empty | VPC Data Missing: The Instance is associated with VPC vpc-01234567 , but Cloudaware has not yet collected data for this VPC, or there are permission issues preventing data collection. |
vpc-01234567 | 00190000000vpc1AAR | Empty | VPC Data Present: The Instance is associated with VPC vpc-01234567 , and Cloudaware has successfully collected and stored the VPC data. |
vpc-01234567 | 00190000000vpc1AAR | 2025-01-01T00:00:00.000Z | Deleted VPC: The Instance is associated with VPC vpc-01234567 , but the VPC has been deleted from the cloud provider, although Cloudaware retains the historical data. |
Naming Conventions and Pronunciation:
In a context of a single relationship between two objects, these fields are usually referred to and pronounced as follows:
lookupId__c
(e.g.,CA10__vpcId__c
): "lookup ID C"lookup__c
(e.g.,CA10__vpc__c
): "lookup C"lookup__r
(e.g.,CA10__vpc__r
): "lookup R"lookup__r.disappearanceTime__c
(e.g.,CA10__vpc__r.CA10__disappearanceTime__c
): "lookup R dot disappearance time"
Impact on Policy Operations:
Operations like FIELD
and EXTRACT
rely on these relationships to navigate and retrieve data across interconnected objects. However, it's crucial to understand that these operations will return a null
value not only when the target field itself is null
, but also in scenarios where the relationship path is incomplete or broken. This can happen if:
- Target Field is Null: The final field in the specified path inherently contains a
null
value in the data. - Missing Lookup ID: Any
lookupId__c
field in the relationship path is empty, indicating the relationship is not established at the cloud provider level. - Missing Lookup Object ID: Any
lookup__c
field in the relationship path is empty, suggesting that Cloudaware data collection is incomplete or has encountered errors for the related object. - Deleted Related Object: Any
lookup__r.CA10__disappearanceTime__c
field in the path is not empty, indicating that a related object in the path has been deleted from the cloud provider. While Cloudaware retains historical data, accessing fields on deleted objects will returnnull
.
Handling Nulls and Undetermined Status:
To distinguish between a legitimate null
value from the field itself and a null
resulting from incomplete lookups, Compliance Engine provides operations like IS_EMPTY_LOOKUP
and NOT_EMPTY_LOOKUP
. These operations are designed to specifically check the health and completeness of object relationships. Using these operations allows you to:
- Handle potential data inconsistencies gracefully and return an
UNDETERMINED
status in your policies when data is unreliable, minimizing false positives and negatives. - Return
COMPLIANT
orINCOMPLIANT
status, when the existence of the related object exists matters for the policy logic.
Operations List
FIELD
FIELD:
path: { fieldPath } # required
undeterminedIf: # optional
isEmpty: { message } # optional
noAccessDelegate: # optional
path: { fieldPath } # required
currentStateMessage: { message } # required
Description
The FIELD
operation allows you to access the value of a specific field within your input object. You specify the field using a path, which can traverse relationships (lookups) to access fields on
related objects.
This operation is intended to be used in logic files during development, for production logic use EXTRACT
operation and FIELD
operation
in extract files.
Parameters
-
path
(string, required):- Specifies the path to the field you want to access.
- The path is a string that can include:
- Field names within the input object (e.g.,
CA10__status__c
). - Relationship names to traverse lookups, followed by field names on the related object (e.g.,
CA10__account__r.CA10__accountId__c
). Relationship names typically end with__r
.
- Field names within the input object (e.g.,
- Example paths:
CA10__status__c
CA10__policyDocument__c
CA10__vpc__r.CA10__isDefault__c
CA10__securityGroup__r.CA10__account__r.CA10__accountId__c
-
undeterminedIf
(object, optional):- Allows you to define conditions under which the
FIELD
operation should return anUNDETERMINED
status instead of a value. This is useful for handling scenarios where a field might be empty or inaccessible due to permissions. - Properties:
isEmpty
(string, optional):- If provided, and the field value at the specified
path
is considered empty byIS_EMPTY
operation, the operation will returnUNDETERMINED
status. - The string value is used as the
currentStateMessage
in the condition when the field is empty andUNDETERMINED
is returned.
- If provided, and the field value at the specified
noAccessDelegate
(object, optional):- Used as a temporary workaround until a dedicated "NO_ACCESS" check is available.
- It checks if a delegate field is empty. If the delegate field is empty, it implies potential access issues to the primary field.
- Primary field and delegate field can match.
- Properties:
path
(string, required): The path to the delegate field to check for emptiness.currentStateMessage
(string, required): ThecurrentStateMessage
to return if the delegate field is empty andUNDETERMINED
status is returned.
- Allows you to define conditions under which the
Return Type
Depending on the type of the field:
Salesforce Field Type | Return Type |
---|---|
ID , Lookup , MasterDetail | Text |
Text , TextArea , EncryptedText | Text |
LongTextArea , RichTextArea | Text |
URL , Email , Phone | Text |
Time | Text |
Picklist | Text |
Number , Percent , Currency , Summary | Number |
Checkbox | Boolean |
DateTime | DateTime |
Date | DateTime |
Examples
-
Accessing field value:
FIELD:
path: CA10__multiRegionTrail__c -
Using
undeterminedIf
withisEmpty
FIELD:
path: CA10__accountId__c
undeterminedIf:
isEmpty: "Account ID can not be empty. Possibly corrupted data." -
Using
undeterminedIf
withnoAccessDelegate
:FIELD:
path: "CA10__versioningMfaDeleteEnabled__c"
undeterminedIf:
noAccessDelegate:
path: "CA10__versioningStatus__c"
currentStateMessage: "Unable to determine versioning status. Possible permission issue with s3:GetBucketVersioning"
EXTRACT
EXTRACT: { path }
Description
The EXTRACT
operation allows you to retrieve a pre-defined, safe-to-use value from your input object. It references an "extract" defined in a separate extract file. Extracts
provide an abstraction layer, allowing you to define reusable logic for accessing and transforming data. This promotes cleaner and more maintainable logic files, especially for production use, as
changes to data access logic can be centralized in extract files rather than spread across multiple logic files. This operation should be used in logic files for production logic
use, while FIELD
operation is recommended for development and in extract files where you define the extraction logic itself.
When using EXTRACT
it is required to add reference corresponding extracts file to importExtracts
section. Add importExtracts
for extracts from types used in the root of the logic to the root and for extracts used in each of relatedLists
to the related lists' importExtracts
section:
inputType: CA10__CaAwsInstance__c
importExtracts:
- file: /types/CA10__CaAwsInstance__c/object.extracts.yaml
- file: /types/CA10__CaAwsVpc__c/object.extracts.yaml
conditions:
- status: UNDETERMINED
currentStateMessage: Status fields are not populated
check:
OR:
args:
- IS_EMPTY:
arg:
EXTRACT: CA10__stateName__c
- IS_EMPTY:
arg:
EXTRACT: CA10__vpc__r.CA10__state__c
# ...
relatedLists:
- relationshipName: CA10__AWS_EBS_Volumes__r
importExtracts:
- file: /types/CA10__CaAwsVolume__c/object.extracts.yaml
conditions:
- status: UNDETERMINED
currentStateMessage: Attachment status is undetermined
check:
IS_EMPTY:
arg:
EXTRACT: CA10__attachmentStatus__c
# ...
Parameters
path
(string, required):- Specifies the path to the extract you want to access.
- The path is a string that can include:
- Extract names within the input object (e.g.,
CA10__status__c
). - Relationship names to traverse lookups, followed by extract name on the related object (e.g.,
CA10__account__r.CA10__accountId__c
). Relationship names typically end with__r
.
- Extract names within the input object (e.g.,
- The extract name must correspond to an extract defined in an available extract file.
- Example paths:
CA10__userName__c
CA10__user__r.CA10__credReportAttributesJson__c
CA10__account__r.CA10__accountId__c
Return Type
Extract can return result from any operation supported by Compliance Engine, so it can return any of supported types.
Examples
-
Using a simple extract:
EXTRACT: CA10__userName__c
-
Using an extract from a related object:
EXTRACT: CA10__user__r.CA10__credReportPasswordLastUsed__c
IS_EMPTY_LOOKUP
IS_EMPTY_LOOKUP: { lookupPath }
Description
The IS_EMPTY_LOOKUP
operation specifically checks whether a lookup field, or a chain of lookups, resolves to an empty value. This operation is designed to address scenarios described in the Relationships Between Objects documentation, where a FIELD
operation might return null
not just because the field is empty, but also because a lookup in the path is broken or incomplete.
IS_EMPTY_LOOKUP
helps distinguish between a truly empty field and a null
value resulting from a broken lookup chain. It returns true
if the lookup path leads to a null or empty object at any point, indicating an incomplete or broken relationship. It returns false
if the lookup path is fully resolved and the final field is not empty (or if the final field itself is null, which is not considered an empty lookup).
This operation is crucial for policies that need to verify the existence and completeness of related objects, especially when dealing with potentially inconsistent or partially collected data in Cloudaware CMDB.
Parameters
lookupPath
(string, required):- Specifies the lookup path to be checked for emptiness.
- The path is a string that can include relationship names to traverse lookups (e.g.,
CA10__vpc__r.CA10__subnet__r
). - The path should point to a lookup field or a chain of lookup fields. Only
lookup__r
fields can be used in the chain of lookups. - Example paths:
CA10__vpc__r
CA10__vpc__r.CA10__subnet__r
Return Type
Examples
-
Checking if a lookup field
CA10__vpc__r
is empty:IS_EMPTY_LOOKUP: CA10__vpc__r
This example checks if the VPC lookup on an EC2 instance is empty, which could indicate that the instance is not associated with a VPC or that VPC data is not available.
-
Checking a chain of lookups
CA10__vpc__r.CA10__subnet__r
for emptiness:IS_EMPTY_LOOKUP: CA10__vpc__r.CA10__subnet__r
This example checks if the subnet lookup, accessed through the VPC lookup, is empty or the VPC lookup itself is empty. This could indicate issues at any point in the lookup chain (instance -> VPC -> subnet).
-
Using
IS_EMPTY_LOOKUP
in a condition to set status toUNDETERMINED
when a lookup is empty:- status: UNDETERMINED
currentStateMessage: "VPC information is not available, status cannot be determined."
check:
IS_EMPTY_LOOKUP: CA10__vpc__rThis condition sets the policy status to
UNDETERMINED
if the VPC lookup is empty, acknowledging the lack of necessary data for evaluation.
NOT_EMPTY_LOOKUP
NOT_EMPTY_LOOKUP: { lookupPath }
Description
The NOT_EMPTY_LOOKUP
operation is the inverse of IS_EMPTY_LOOKUP
. It checks whether a lookup field, or a chain of lookups, is fully populated with objects. This operation is also designed to address scenarios described in the Relationships Between Objects documentation, focusing on ensuring that a lookup path successfully resolves to a non-empty object.
NOT_EMPTY_LOOKUP
returns true
if the entire lookup path is successfully resolved and leads to a non-empty object. It returns false
if any part of the lookup path is broken, incomplete, or resolves to a null or empty object.
This operation is essential for policies that require verification of complete and valid object relationships, ensuring data integrity and reliability in policy evaluations.
Parameters
lookupPath
(string, required):- Specifies the lookup path to be checked for non-emptiness.
- The path is a string that can include relationship names to traverse lookups (e.g.,
CA10__vpc__r.CA10__subnet__r
). - The path should point to a lookup field or a chain of lookup fields. Only
lookup__r
fields can be used in the chain of lookups. - Example paths:
CA10__vpc__r
CA10__vpc__r.CA10__subnet__r
Return Type
Examples
-
Checking if a lookup field
CA10__vpc__r
is not empty:NOT_EMPTY_LOOKUP: CA10__vpc__r
This example verifies that the VPC lookup on an EC2 instance is successfully resolved and the VPC data is available.
-
Checking a chain of lookups
CA10__vpc__r.CA10__subnet__r
for non-emptiness:NOT_EMPTY_LOOKUP: CA10__vpc__r.CA10__subnet__r
This example ensures that the entire lookup chain from instance to subnet (via VPC) is valid and data is available at each step.
TEXT
TEXT: { value }
Description
The TEXT
operation creates a constant text (string) value. This operation allows you to embed static text directly within your logic.
Parameters
value
(string, required):- Specifies the text string you want to use as a constant.
- This value will be directly returned by the operation.
- The text value cannot be null or empty string.