Skip to main content

🧠 AWS SageMaker Endpoint has less than 2 instances - prod.logic.yaml🟒

Uses​

Test Results πŸŸ’β€‹

Generated at: 2026-01-24T12:02:26.439701062Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 199βœ”οΈ extract('CA10A1__status__c') != 'InService'βœ”οΈ null
🟒test2βœ”οΈ 399βœ”οΈ extract('caJsonFrom__productionVariantsJson__c').jsonQueryText('length([?initialInstanceCount < 2])') > number(0.0)βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ isEmptyLookup('CA10A1__endpointConfig__r')βœ”οΈ null
🟒test4βœ”οΈ 500βœ”οΈ otherwiseβœ”οΈ null
🟒test5βœ”οΈ 304βœ”οΈ CA10A1__productionVariantsJson__c.delegatedTo(CA10A1__productionVariantsJson__c).isEmpty()βœ”οΈ null
🟒test6βœ”οΈ 304βœ”οΈ CA10A1__productionVariantsJson__c.delegatedTo(CA10A1__productionVariantsJson__c).isEmpty()βœ”οΈ null
🟒test7βœ”οΈ 499βœ”οΈ extract('caJsonFrom__productionVariantsJson__c').jsonQueryText('length([?initialInstanceCount > 1])') > number(0.0)βœ”οΈ null

Generation Bundle​

FileMD5
Open/ce/ca/aws/sagemaker/endpoint-instance-count/policy.yaml5122F1CB7CD54E5BF9DA79CE77FDA4FF
Open/ce/ca/aws/sagemaker/endpoint-instance-count/prod.logic.yamlDAFB1379E318D4D93521C41327C5E763
Open/ce/ca/aws/sagemaker/endpoint-instance-count/test-data.json98698444856473108388629ABB153214
Open/types/CA10A1__CaAwsSageMakerEndpoint__c/object.extracts.yaml6FEF5F0D1482FCEDF426200AE2C8E910
Open/types/CA10A1__CaAwsSageMakerEndpointConfig__c/object.extracts.yamlC98A8ED84E6D2328252FC7FA00A80C30

Available Commands​

repo-manager policies generate FULL /ce/ca/aws/sagemaker/endpoint-instance-count/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/sagemaker/endpoint-instance-count/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/sagemaker/endpoint-instance-count/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/sagemaker/endpoint-instance-count/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/sagemaker/endpoint-instance-count/prod.logic.yaml

Content​

Open File

---
inputType: "CA10A1__CaAwsSageMakerEndpoint__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10A1__CaAwsSageMakerEndpoint__c/object.extracts.yaml"
- file: "/types/CA10A1__CaAwsSageMakerEndpointConfig__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "The SageMaker Endpoint is not in service."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10A1__status__c"
right:
TEXT: "InService"
- status: "UNDETERMINED"
currentStateMessage: "The Endpoint Configuration or its production variants are not present in the CMDB."
check:
IS_EMPTY_LOOKUP: "CA10A1__endpointConfig__r"
- status: "INCOMPLIANT"
currentStateMessage: "At least one production variant in the endpoint configuration has an instance count less than 2."
remediationMessage: "Increase the instance count for all production variants to at least 2."
check:
# Evaluates the JSON array of variants to see if any have initialInstanceCount < 2
GREATER_THAN:
left:
JSON_QUERY_NUMBER:
arg:
EXTRACT: "caJsonFrom__productionVariantsJson__c"
expression: "length([?initialInstanceCount < `2`])"
undeterminedIf:
evaluationError: "Failed to query the production variants JSON."
resultTypeMismatch: "Query did not return a number."
right:
NUMBER: 0
- status: "COMPLIANT"
currentStateMessage: "All production variants for this endpoint have at least two instances configured."
check:
# Evaluates the JSON array of variants to see if any have initialInstanceCount > 1
GREATER_THAN:
left:
JSON_QUERY_NUMBER:
arg:
EXTRACT: "caJsonFrom__productionVariantsJson__c"
expression: "length([?initialInstanceCount > `1`])"
undeterminedIf:
evaluationError: "Failed to query the production variants JSON."
resultTypeMismatch: "Query did not return a number."
right:
NUMBER: 0
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unable to determine the initial instance count of the Endpoint Config."