π§ AWS API Gateway API Execution Logging in CloudWatch is not enabled - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml
- Located in: π AWS API Gateway API Execution Logging in CloudWatch is not enabled π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS API Gateway API | CA10__CaAwsApiGatewayRestApi__c | 2 | 1 | 3 |
Usesβ
- π AWS API Gateway Stage - object.extracts.yaml
- π AWS API Gateway API - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:44:18.869712027Z Open
Result | Id | Condition Index | Condition Text | Runtime 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β
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/apigateway/api-execution-logging/policy.yaml | B7FFBE831BC47D31D42C2A0A0192F55C |
Open | /ce/ca/aws/apigateway/api-execution-logging/prod.logic.yaml | F8B79DD06EE0EBA2617E255FB0A4CE05 |
Open | /types/CA10__CaAwsApiGatewayStage__c/object.extracts.yaml | BFC9531C779AD876E602BE4C7AFCAE82 |
Open | /ce/ca/aws/apigateway/api-execution-logging/test-data.json | F06FEB4B3D78B3C2B7BB9C6183F63E22 |
Open | /types/CA10__CaAwsApiGatewayRestApi__c/object.extracts.yaml | 746F09341E8149BAD88C53E274DB1DD5 |
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β
---
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."