Skip to main content

🧠 AWS API Gateway REST API Detailed CloudWatch Metrics are not enabled - prod.logic.yaml🟒

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-12-27T12:01:39.223166372Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒001βœ”οΈ 199βœ”οΈ not(setOfText(['restApi']).contains(RecordType.DeveloperName))βœ”οΈ null
🟒002βœ”οΈ 299βœ”οΈ CA10__AWS_API_Gateway_Stages__r.count(COMPLIANT) == number(0.0)βœ”οΈ null
🟒003βœ”οΈ 399βœ”οΈ CA10__AWS_API_Gateway_Stages__r.has(INCOMPLIANT)βœ”οΈ null
🟒004βœ”οΈ 400βœ”οΈ otherwiseβœ”οΈ null

Generation Bundle​

FileMD5
Open/ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/policy.yaml91CD4D218AA2945DC5AA2903AEA04011
Open/ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/prod.logic.yamlC476CB03687A24E3103189940593FAC8
Open/ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/test-data.jsonFC9F638A748647E918277495758C2A22
Open/types/CA10__CaAwsApiGatewayStage__c/object.extracts.yaml4C63240D980BDDAFE321E6FFAC8F9034

Available Commands​

repo-manager policies generate FULL /ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/apigateway/rest-api-detailed-cloudwatch-metrics/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAwsApiGatewayRestApi__c"
testData:
- file: test-data.json
recordTypes:
- restApi
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "There is no related API Stage where CloudWatch Metrics are enabled."
remediationMessage: "Consider enabling CloudWatch Metrics for the API Stage."
check:
IS_EQUAL:
left:
RELATED_LIST_COUNT:
status: "COMPLIANT"
relationshipName: "CA10__AWS_API_Gateway_Stages__r"
right:
NUMBER: 0.0
- status: "INCOMPLIANT"
currentStateMessage: "There is at least one related API Stage where CloudWatch Metrics are not enabled."
remediationMessage: "Consider enabling CloudWatch Metrics for the API Stage."
check:
RELATED_LIST_HAS:
relationshipName: "CA10__AWS_API_Gateway_Stages__r"
status: "INCOMPLIANT"
otherwise:
status: "COMPLIANT"
currentStateMessage: "CloudWatch Metrics for all API Stages are enabled."
relatedLists:
- relationshipName: "CA10__AWS_API_Gateway_Stages__r"
importExtracts:
- file: "/types/CA10__CaAwsApiGatewayStage__c/object.extracts.yaml"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "CloudWatch Metrics are not enabled for this API Stage."
remediationMessage: "Consider enabling CloudWatch Metrics for this API Stage."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__cloudWatchMetricsEnabled__c"
right:
BOOLEAN: false
otherwise:
status: "COMPLIANT"
currentStateMessage: "CloudWatch Metrics are enabled."