Skip to main content

Repository → 📁 Compliance Engine → 📁 CloudAware → 📁 Google → 📁 GCE → 🛡️ Instance is underutilized🟢

🧠 Google GCE Instance is underutilized - prod.logic.yaml🟢

Uses

Test Results 🟢

Generated at: 2025-10-01T12:50:12.210131469Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟢test1✔️ 99✔️ isDisappeared(CA10__disappearanceTime__c)✔️ null
🟢test2✔️ 199✔️ extract('CA10__status__c') != 'RUNNING'✔️ null
🟢test3✔️ 299✔️ extract('CA10__creationDate__c').withinLastDays(14)✔️ null
🟢test4✔️ 399✔️ extract('CA10__averageCpuTwoWeeks__c').isEmpty() || extract('CA10__maxCpuTwoWeeks__c').isEmpty()✔️ null
🟢test5✔️ 599✔️ extract('CA10__averageCpuTwoWeeks__c') < number(40.0) && extract('CA10__maxCpuTwoWeeks__c') < number(50.0)✔️ null
🟢test6✔️ 499✔️ extract('CA10__averageCpuTwoWeeks__c') < number(5.0) && extract('CA10__maxCpuTwoWeeks__c') < number(15.0) && extract('CA10__sumTwoWeekNetworkInMb__c') < number(100.0) && extract('CA10__sumTwoWeekNetworkOutMb__c') < number(100.0)✔️ null
🟢test7✔️ 599✔️ extract('CA10__averageCpuTwoWeeks__c') < number(40.0) && extract('CA10__maxCpuTwoWeeks__c') < number(50.0)✔️ null
🟢test8✔️ 600✔️ otherwise✔️ null

Generation Bundle

FileMD5
Open/ce/ca/google/compute-engine/instance-underutilized/policy.yamlE866D62BD3C610EDEC967B6975F4F295
Open/ce/ca/google/compute-engine/instance-underutilized/prod.logic.yamlE256CAB834F6676B3B8AD106DE3A4580
Open/ce/ca/google/compute-engine/instance-underutilized/test-data.jsonA47C0D042C4101E69DFCC3FDE006727B
Open/types/CA10__CaGoogleGceInstance__c/object.extracts.yaml75A538D7EA49443F6DA07C5D35BF9021

Available Commands

repo-manager policies generate FULL /ce/ca/google/compute-engine/instance-underutilized/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/google/compute-engine/instance-underutilized/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/google/compute-engine/instance-underutilized/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/google/compute-engine/instance-underutilized/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/google/compute-engine/instance-underutilized/prod.logic.yaml

Content

Open File

---
inputType: "CA10__CaGoogleGceInstance__c"
importExtracts:
- file: "/types/CA10__CaGoogleGceInstance__c/object.extracts.yaml"
testData:
- file: 'test-data.json'
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The Instance is not running."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__status__c"
right:
TEXT: "RUNNING"
- status: "INAPPLICABLE"
currentStateMessage: "The instance has been running for less than 14 days."
check:
IS_WITHIN_LAST_DAYS:
offsetDays: 14
arg:
EXTRACT: "CA10__creationDate__c"
- status: "UNDETERMINED"
currentStateMessage: "There is not enough data in the CMDB to identify if the instance is underutilized."
check:
OR:
args:
- IS_EMPTY:
arg:
EXTRACT: "CA10__averageCpuTwoWeeks__c"
- IS_EMPTY:
arg:
EXTRACT: "CA10__maxCpuTwoWeeks__c"
- status: "INAPPLICABLE"
currentStateMessage: "The Instance is idle and considered by the 'Google Cloud SQL Instance is idle' policy."
check:
AND:
args:
- LESS_THAN:
left:
EXTRACT: CA10__averageCpuTwoWeeks__c
right:
NUMBER: 5.0
- LESS_THAN:
left:
EXTRACT: CA10__maxCpuTwoWeeks__c
right:
NUMBER: 15.0
- LESS_THAN:
left:
EXTRACT: CA10__sumTwoWeekNetworkInMb__c
right:
NUMBER: 100.0
- LESS_THAN:
left:
EXTRACT: CA10__sumTwoWeekNetworkOutMb__c
right:
NUMBER: 100.0
- status: "INCOMPLIANT"
currentStateMessage: "The instance is underutilized with Average CPU Utilization < 40%\
\ and Max CPU Utilization < 50%."
remediationMessage: "Consider rightsizing, consolidating or terminating the instance."
check:
AND:
args:
- LESS_THAN:
left:
EXTRACT: CA10__averageCpuTwoWeeks__c
right:
NUMBER: 40.0
- LESS_THAN:
left:
EXTRACT: CA10__maxCpuTwoWeeks__c
right:
NUMBER: 50.0
otherwise:
status: "COMPLIANT"
currentStateMessage: 'The Instance is not underutilized.'