Skip to main content

🧠 AWS API Gateway API Execution Logging in CloudWatch is not enabled - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS API Gateway APICA10__CaAwsApiGatewayRestApi__c213

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:44:18.869712027Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ extract('CA10__protocolType__c') == 'HTTP'βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ CA10__AWS_API_Gateway_Stages__r.has(INCOMPLIANT)βœ”οΈ null
🟒test4βœ”οΈ 300βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/aws/apigateway/api-execution-logging/policy.yamlB7FFBE831BC47D31D42C2A0A0192F55C
Open/ce/ca/aws/apigateway/api-execution-logging/prod.logic.yamlF8B79DD06EE0EBA2617E255FB0A4CE05
Open/types/CA10__CaAwsApiGatewayStage__c/object.extracts.yamlBFC9531C779AD876E602BE4C7AFCAE82
Open/ce/ca/aws/apigateway/api-execution-logging/test-data.jsonF06FEB4B3D78B3C2B7BB9C6183F63E22
Open/types/CA10__CaAwsApiGatewayRestApi__c/object.extracts.yaml746F09341E8149BAD88C53E274DB1DD5

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAwsApiGatewayRestApi__c"
importExtracts:
- file: "/types/CA10__CaAwsApiGatewayStage__c/object.extracts.yaml"
- file: "/types/CA10__CaAwsApiGatewayRestApi__c/object.extracts.yaml"
testData:
- file: test-data.json
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "HTTP API does not support execution logs."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__protocolType__c"
right:
TEXT: "HTTP"
- status: "INCOMPLIANT"
currentStateMessage: "There is at least one related API Stage where CloudWatch Execution Logs are not enabled."
remediationMessage: "Consider enabling CloudWatch Execution Logs for the API Stage."
check:
RELATED_LIST_HAS:
relationshipName: "CA10__AWS_API_Gateway_Stages__r"
status: "INCOMPLIANT"
otherwise:
status: "COMPLIANT"
currentStateMessage: "API is compliant"
relatedLists:
- relationshipName: "CA10__AWS_API_Gateway_Stages__r"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "CloudWatch Execution Logs are not enabled for this API Stage."
remediationMessage: "Consider enabling CloudWatch Execution Logs for this API Stage."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10__cloudWatchLogLevel__c"
- status: "INCOMPLIANT"
currentStateMessage: "CloudWatch Execution Logs are turned off for this API Stage."
remediationMessage: "Consider enabling CloudWatch Execution Logs for this API Stage."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__cloudWatchLogLevel__c"
right:
TEXT: "OFF"
otherwise:
status: "COMPLIANT"
currentStateMessage: "CloudWatch Execution Logs are enabled."