⭐ Repository → 📁 Compliance Engine → 📁 CloudAware → 📁 Google → 📁 Cloud SQL → 🛡️ Instance is idle🟢
🧠 Google Cloud SQL Instance is idle - prod.logic.yaml🟢
- Contextual name: 🧠 prod.logic.yaml🟢
- ID:
/ce/ca/google/sql/instance-idle/prod.logic.yaml
- Tags:
Uses
Test Results 🟢
Generated at: 2025-10-01T12:50:56.831650714Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
🟢 | 001 | ✔️ 99 | ✔️ isDisappeared(CA10__disappearanceTime__c) | ✔️ null |
🟢 | 002 | ✔️ 199 | ✔️ extract('CA10__state__c') != 'RUNNABLE' | ✔️ null |
🟢 | 003 | ✔️ 299 | ✔️ not(extract('CA10__createTime__c').beyondLastDays(30)) | ✔️ null |
🟢 | 004 | ✔️ 399 | ✔️ extract('CA10__cpuUtilizationAvg30Day__c').isEmpty() || extract('CA10__cloudSqlConnectionsAvg30Day__c').isEmpty() | ✔️ null |
🟢 | 005 | ✔️ 499 | ✔️ extract('CA10__cpuUtilizationAvg30Day__c') < number(5.0) && extract('CA10__cloudSqlConnectionsAvg30Day__c') <= number(0.0) | ✔️ null |
🟢 | 006 | ✔️ 500 | ✔️ otherwise | ✔️ null |
Generation Bundle
File | MD5 | |
---|---|---|
Open | /ce/ca/google/sql/instance-idle/policy.yaml | 2FFB42BBE1BE8497C0ADA236AFDD2B9E |
Open | /ce/ca/google/sql/instance-idle/prod.logic.yaml | 926E5ABFDCE1F224DD8DD5BEF312325B |
Open | /ce/ca/google/sql/instance-idle/test-data.json | 1CABC87D1CB36B45588BAFD984DCC500 |
Open | /types/CA10__CaGoogleSqlInstance__c/object.extracts.yaml | 8DD86EFB2FFA06BD1E9BC0452FF2EC8A |
Available Commands
repo-manager policies generate FULL /ce/ca/google/sql/instance-idle/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/google/sql/instance-idle/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/google/sql/instance-idle/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/google/sql/instance-idle/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/google/sql/instance-idle/prod.logic.yaml
Content
---
inputType: "CA10__CaGoogleSqlInstance__c"
importExtracts:
- file: "/types/CA10__CaGoogleSqlInstance__c/object.extracts.yaml"
testData:
- file: 'test-data.json'
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The Instance is not running."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__state__c"
right:
TEXT: "RUNNABLE"
- status: "INAPPLICABLE"
currentStateMessage: "The instance has been created less than 30 days ago."
check:
NOT:
arg:
IS_BEYOND_LAST_DAYS:
offsetDays: 30
arg:
EXTRACT: "CA10__createTime__c"
- status: "UNDETERMINED"
currentStateMessage: "There is not enough data in the CMDB to identify if the instance is idle."
check:
OR:
args:
- IS_EMPTY:
arg:
EXTRACT: "CA10__cpuUtilizationAvg30Day__c"
- IS_EMPTY:
arg:
EXTRACT: "CA10__cloudSqlConnectionsAvg30Day__c"
- status: "INCOMPLIANT"
currentStateMessage: "The instance is idle with Average CPU Utilization < 5% and\
\ zero Average Connections."
remediationMessage: "Consider stopping, terminating, or rightsizing the instance."
check:
AND:
args:
- LESS_THAN:
left:
EXTRACT: CA10__cpuUtilizationAvg30Day__c
right:
NUMBER: 5.0
- LESS_THAN_EQUAL:
left:
EXTRACT: CA10__cloudSqlConnectionsAvg30Day__c
right:
NUMBER: 0.0
otherwise:
status: "COMPLIANT"
currentStateMessage: "The instance is not idle."