π§ Azure Cosmos DB Account has zero Total Request Units - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml
- Located in: π Azure Cosmos DB Account has zero Total Request Units π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Azure Cosmos DB Account | CA10__CaAzureCosmosDbAccount__c | 3 | 1 | 3 |
Usesβ
Test Results π’β
Generated at: 2025-05-10T12:02:38.172718882Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | 1 | βοΈ 199 | βοΈ extract('CA10__capabilities__c').contains('EnableServerless') | βοΈ null |
π’ | 2 | βοΈ 299 | βοΈ extract('CA10__monitorTotalRequestUnitsSum30Day__c') == number(0.0) | βοΈ null |
π’ | 3 | βοΈ 300 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/azure/cosmos-db/idle-cosmosdb-account/policy.yaml | DB5D6CFED96B744E6F3EEC035BBCC5BF |
Open | /ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml | 7731EB6BBF409D9C8CD589C1C318C029 |
Open | /types/CA10__CaAzureCosmosDbAccount__c/object.extracts.yaml | D218FD427CEE53CFCE79E554F5C4662A |
Open | /ce/ca/azure/cosmos-db/idle-cosmosdb-account/test-data.json | 7294C126F2B3A03C5E099BD0EDD5E413 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/azure/cosmos-db/idle-cosmosdb-account/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAzureCosmosDbAccount__c"
testData:
- file: "test-data.json"
importExtracts:
- file: /types/CA10__CaAzureCosmosDbAccount__c/object.extracts.yaml
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "Azure Cosmos DB serverless account type."
check:
CONTAINS:
arg:
EXTRACT: "CA10__capabilities__c"
substring:
TEXT: "EnableServerless"
- status: "INCOMPLIANT"
currentStateMessage: "The Cosmos DB Account has zero Total Request Units for the
past 30 days."
remediationMessage: "Consider deleting the Cosmos DB Account or switching to
the serverless option."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__monitorTotalRequestUnitsSum30Day__c"
right:
NUMBER: 0.0
otherwise:
status: "COMPLIANT"
currentStateMessage: "The Cosmos DB Account has Total Request Units for the past 30 days."