π§ Google Cloud SQL Instance Automated Backups are not configured - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/google/sql/sql-instance-backup/prod.logic.yaml
- Located in: π Google Cloud SQL Instance Automated Backups are not configured π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Google Cloud SQL Instance | CA10__CaGoogleSqlInstance__c | 28 | 1 | 21 |
Usesβ
Test Results π’β
Generated at: 2025-04-24T23:47:29.093684135Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | a8ED7 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
π’ | a8E479 | βοΈ 199 | βοΈ extract('CA10__instanceType__c') == 'READ_REPLICA_INSTANCE' | βοΈ null |
π’ | a8E47 | βοΈ 299 | βοΈ extract('CA10__backupEnabled__c') == true && extract('CA10__backupStartTime__c').isNotEmpty() | βοΈ null |
π’ | a8ED77 | βοΈ 300 | βοΈ otherwise | βοΈ null |
π’ | a8E477 | β οΈ 300 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/google/sql/sql-instance-backup/policy.yaml | 4033A143B8AA5C21D0E50FE6C2EECF55 |
Open | /ce/ca/google/sql/sql-instance-backup/prod.logic.yaml | E93BE1007D3A97AE9D19F7807D547CF8 |
Open | /types/CA10__CaGoogleSqlInstance__c/object.extracts.yaml | CF5DA82560FA69E6A48E44B5BF123F0B |
Open | /ce/ca/google/sql/sql-instance-backup/test-data.json | 11D429AF5CA5FC83866E8FB964640319 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/google/sql/sql-instance-backup/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/google/sql/sql-instance-backup/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/google/sql/sql-instance-backup/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/google/sql/sql-instance-backup/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/google/sql/sql-instance-backup/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaGoogleSqlInstance__c"
testData:
- file: test-data.json
importExtracts:
- file: /types/CA10__CaGoogleSqlInstance__c/object.extracts.yaml
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "GCP does not provide Automated Backups for read-replica instances."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__instanceType__c"
right:
TEXT: "READ_REPLICA_INSTANCE"
- status: "COMPLIANT"
currentStateMessage: "SQL instance automated backups are configured."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__backupEnabled__c"
right:
BOOLEAN: true
- NOT_EMPTY:
arg:
EXTRACT: CA10__backupStartTime__c
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "Automated backups disabled for the Cloud SQL database instance."
remediationMessage: "Enable Automated backups for Cloud SQL database instance."