---
policy: /ce/ca/aws/account/config-in-all-regions
logic: /ce/ca/aws/account/config-in-all-regions/prod.logic.yaml
executionTime: 2025-04-24T23:44:06.498466898Z
rows:
  - id: test2
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10__AWS_Config_Settings__r.has(INCOMPLIANT)
      actual: CA10__AWS_Config_Settings__r.has(INCOMPLIANT)
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10__AWS_Config_Settings__r.has(INCOMPLIANT)
      actual: CA10__AWS_Config_Settings__r.has(INCOMPLIANT)
    runtimeError: {}
  - id: test4
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10__AWS_Config_Settings__r.has(INCOMPLIANT)
      actual: CA10__AWS_Config_Settings__r.has(INCOMPLIANT)
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: CA10__AWS_Config_Settings__r.has(COMPLIANT)
      actual: CA10__AWS_Config_Settings__r.has(COMPLIANT)
    runtimeError: {}
  - id: test6
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: CA10__AWS_Config_Settings__r.has(INAPPLICABLE)
      actual: CA10__AWS_Config_Settings__r.has(INAPPLICABLE)
    runtimeError: {}
  - id: test7
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 400
      actual: 400
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/aws/account/config-in-all-regions/policy.yaml
    md5Hash: C132232DA550A863C8874220C8968703
    content: |
      ---
      names:
        full: AWS Account Config is not enabled in all regions
        contextual: Config is not enabled in all regions
      description: "AWS Config is a web service that performs configuration management of\
        \ supported AWS resources within your account and delivers log files to you. The\
        \ recorded information includes the configuration item (AWS resource), relationships\
        \ between configuration items (AWS resources), any configuration changes between\
        \ resources. It is recommended AWS Config be enabled in all regions."
      type: COMPLIANCE_POLICY
      categories:
        - RELIABILITY
        - SECURITY
      frameworkMappings:
        - "/frameworks/cis-aws-v5.0.0/03/03"
        - "/frameworks/cloudaware/resource-reliability/system-configuration"
        - "/frameworks/aws-fsbp-v1.0.0/config/01"
      similarPolicies:
        internal:
          - dec-x-88fa51c8
        cloudConformity:
          - url: https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/Config/aws-config-enabled.html
            name: AWS Config Enabled
  - path: /ce/ca/aws/account/config-in-all-regions/prod.logic.yaml
    md5Hash: F7A71BA5FC80CE1283B4D0F6CD59E3C3
    content: "---\ninputType: \"CA10__CaAwsAccount__c\"\ntestData:\n  - file: \"test-data.json\"\
      \nconditions:\n  - status: \"INCOMPLIANT\"\n    currentStateMessage: \"AWS Config\
      \ is not enabled in all regions.\"\n    remediationMessage: \"Consider configuring\
      \ AWS Config for all regions.\"\n    check:\n      RELATED_LIST_HAS:\n     \
      \   status: \"INCOMPLIANT\"\n        relationshipName: \"CA10__AWS_Config_Settings__r\"\
      \n  - status: \"COMPLIANT\"\n    currentStateMessage: \"AWS Config is enabled\
      \ in all regions.\"\n    check:\n      RELATED_LIST_HAS:\n        status: \"\
      COMPLIANT\"\n        relationshipName: \"CA10__AWS_Config_Settings__r\"\n  -\
      \ status: \"INCOMPLIANT\"\n    currentStateMessage: \"The AWS Config doesn't\
      \ have a recorder configured to include global resource types.\"\n    remediationMessage:\
      \ \"Ensure that at least one AWS Config Recorder is configured to include global\
      \ resource types.\"\n    check:\n      RELATED_LIST_HAS:\n        status: \"\
      INAPPLICABLE\"\n        relationshipName: \"CA10__AWS_Config_Settings__r\"\n\
      # There is a possibility that we don't have access to AWS Config Recorders \n\
      otherwise:\n  status: \"INCOMPLIANT\"\n  currentStateMessage: \"AWS Config is\
      \ not enabled.\"\n  remediationMessage: \"Consider enabling AWS Config for all\
      \ regions.\"\nrelatedLists:\n  - relationshipName: \"CA10__AWS_Config_Settings__r\"\
      \n    importExtracts:\n    - file: \"/types/CA10__CaAwsConfigRecorder__c/object.extracts.yaml\"\
      \n    conditions:\n      - status: \"INCOMPLIANT\"\n        currentStateMessage:\
      \ \"This AWS Config Recorder is not configured properly.\"\n        remediationMessage:\
      \ \"Consider reconfiguring the AWS Config Recorder.\"\n        check:\n    \
      \      OR:\n            args:\n              - IS_EQUAL:\n                 \
      \ left:\n                    EXTRACT: \"CA10__allSupported__c\"\n          \
      \        right:\n                    BOOLEAN: false\n              - IS_EQUAL:\n\
      \                  left:\n                    EXTRACT: \"CA10__recording__c\"\
      \n                  right:\n                    BOOLEAN: false\n           \
      \   - NOT_EQUAL:\n                  left:\n                    EXTRACT: \"CA10__lastStatus__c\"\
      \n                  right:\n                    TEXT: \"SUCCESS\"\n# At least\
      \ one recorder has to have a CA10__includeGlobalResourceTypes__c enabled \n\
      \      - status: \"COMPLIANT\"\n        currentStateMessage: \"This AWS Config\
      \ Recorder is configured to include global resource types.\"\n        check:\n\
      \          IS_EQUAL:\n            left:\n              EXTRACT: \"CA10__includeGlobalResourceTypes__c\"\
      \n            right:\n              BOOLEAN: true             \n    otherwise:\n\
      \      status: \"INAPPLICABLE\"\n      currentStateMessage: \"This AWS Config\
      \ Recorder is configured properly.\""
  - path: /types/CA10__CaAwsConfigRecorder__c/object.extracts.yaml
    md5Hash: 2C6647BB9543EFA1F66FF477131CFCF0
    content: "---\nextracts:\n# Checkbox. Can't have no access, retrieved via config:DescribeConfigurationRecorders\n\
      \  - name: \"CA10__allSupported__c\"\n    value: \n      FIELD:\n        path:\
      \ \"CA10__allSupported__c\"\n# Checkbox. Can't have no access, retrieved via\
      \ config:DescribeConfigurationRecorders\n  - name: \"CA10__includeGlobalResourceTypes__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10__includeGlobalResourceTypes__c\"\
      \n# Values: Pending, Success, Failure. Not Nullable.\n  - name: \"CA10__lastStatus__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10__lastStatus__c\"\n       \
      \ undeterminedIf:\n          noAccessDelegate:\n            path: \"CA10__lastStatus__c\"\
      \n            currentStateMessage: \"Unable to determine Config Recorder status.\
      \ Possible permission issue with config:DescribeConfigurationRecorderStatus.\"\
      \n# Checkbox. \n  - name: \"CA10__recording__c\"\n    value: \n      FIELD:\n\
      \        path: \"CA10__recording__c\"\n        undeterminedIf:\n          noAccessDelegate:\n\
      \            path: \"CA10__recording__c\"\n            currentStateMessage:\
      \ \"Unable to determine Config Recorder status. Possible permission issue with\
      \ config:DescribeConfigurationRecorderStatus.\""
  - path: /ce/ca/aws/account/config-in-all-regions/test-data.json
    md5Hash: B6755D8F585CD0FFB7927B5BA7C6E97B
    content: |-
      [
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2024-05-28T17:35:50Z"
              },
              "Id": "test2",
              "CA10__AWS_Config_Settings__r": [
                  {
                      "Id": "test2_1",
                      "CA10__disappearanceTime__c": null,
                      "CA10__allSupported__c": false,
                      "CA10__recording__c": true,
                      "CA10__lastStatus__c": "SUCCESS",
                      "CA10__includeGlobalResourceTypes__c": true,
                      "CA10__account__c": "test2"
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2024-05-28T17:35:50Z"
              },
              "Id": "test3",
              "CA10__AWS_Config_Settings__r": [
                  {
                      "Id": "test3_1",
                      "CA10__disappearanceTime__c": null,
                      "CA10__allSupported__c": true,
                      "CA10__recording__c": false,
                      "CA10__lastStatus__c": "SUCCESS",
                      "CA10__includeGlobalResourceTypes__c": true,
                      "CA10__account__c": "test3"
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "199",
                  "conditionText": "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2024-05-28T17:35:50Z"
              },
              "Id": "test4",
              "CA10__AWS_Config_Settings__r": [
                  {
                      "Id": "test4_1",
                      "CA10__disappearanceTime__c": null,
                      "CA10__allSupported__c": true,
                      "CA10__recording__c": true,
                      "CA10__lastStatus__c": "Pending",
                      "CA10__includeGlobalResourceTypes__c": true,
                      "CA10__account__c": "test4"
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "299",
                  "conditionText": "CA10__AWS_Config_Settings__r.has(COMPLIANT)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2024-05-28T17:35:50Z"
              },
              "Id": "test5",
              "CA10__AWS_Config_Settings__r": [
                  {
                      "Id": "test5_1",
                      "CA10__disappearanceTime__c": null,
                      "CA10__allSupported__c": true,
                      "CA10__recording__c": true,
                      "CA10__lastStatus__c": "SUCCESS",
                      "CA10__includeGlobalResourceTypes__c": true,
                      "CA10__account__c": "test5"
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "CA10__AWS_Config_Settings__r.has(INAPPLICABLE)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2024-05-28T17:35:50Z"
              },
              "Id": "test6",
              "CA10__AWS_Config_Settings__r": [
                  {
                      "Id": "test6_1",
                      "CA10__disappearanceTime__c": null,
                      "CA10__allSupported__c": true,
                      "CA10__recording__c": true,
                      "CA10__lastStatus__c": "SUCCESS",
                      "CA10__includeGlobalResourceTypes__c": false,
                      "CA10__account__c": "test6"
                  }
              ]
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "400",
                  "conditionText": "otherwise",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2024-05-28T17:35:50Z"
              },
              "Id": "test7",
              "CA10__AWS_Config_Settings__r": []
          }
      ]
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "test2",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test4",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "299",
      "conditionText" : "CA10__AWS_Config_Settings__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test6",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "CA10__AWS_Config_Settings__r.has(INAPPLICABLE)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test7",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "400",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsAccount__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test6"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test7"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsConfigRecorder__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__allSupported__c BOOLEAN,
      CA10__recording__c BOOLEAN,
      CA10__lastStatus__c STRING,
      CA10__includeGlobalResourceTypes__c BOOLEAN,
      CA10__account__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test2_1",
    "CA10__allSupported__c" : false,
    "CA10__recording__c" : true,
    "CA10__lastStatus__c" : "SUCCESS",
    "CA10__includeGlobalResourceTypes__c" : true,
    "CA10__account__c" : "test2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test3_1",
    "CA10__allSupported__c" : true,
    "CA10__recording__c" : false,
    "CA10__lastStatus__c" : "SUCCESS",
    "CA10__includeGlobalResourceTypes__c" : true,
    "CA10__account__c" : "test3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test4_1",
    "CA10__allSupported__c" : true,
    "CA10__recording__c" : true,
    "CA10__lastStatus__c" : "Pending",
    "CA10__includeGlobalResourceTypes__c" : true,
    "CA10__account__c" : "test4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test5_1",
    "CA10__allSupported__c" : true,
    "CA10__recording__c" : true,
    "CA10__lastStatus__c" : "SUCCESS",
    "CA10__includeGlobalResourceTypes__c" : true,
    "CA10__account__c" : "test5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-05-28T17:35:50Z")
    },
    "Id" : "test6_1",
    "CA10__allSupported__c" : true,
    "CA10__recording__c" : true,
    "CA10__lastStatus__c" : "SUCCESS",
    "CA10__includeGlobalResourceTypes__c" : false,
    "CA10__account__c" : "test6"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaAwsAccount__c(
      obj STRUCT<
          Id STRING,
          CA10__AWS_Config_Settings__r ARRAY<STRUCT<
              Id STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__allSupported__c BOOLEAN,
              CA10__recording__c BOOLEAN,
              CA10__lastStatus__c STRING,
              CA10__includeGlobalResourceTypes__c BOOLEAN,
              CA10__account__c STRING,
              result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
          >>
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      if (false) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared()", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__AWS_Config_Settings__r_INCOMPLIANT2 = 0;
      if (obj.CA10__AWS_Config_Settings__r != null) {
          for (var i3 = 0; i3 < obj.CA10__AWS_Config_Settings__r.length; i3++) {
              if (obj.CA10__AWS_Config_Settings__r[i3].result.status == 'INCOMPLIANT') {
                  count_CA10__AWS_Config_Settings__r_INCOMPLIANT2 += 1;
              }
          }
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Related list [CA10__AWS_Config_Settings__r] ' + (count_CA10__AWS_Config_Settings__r_INCOMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in INCOMPLIANT status');
      if (count_CA10__AWS_Config_Settings__r_INCOMPLIANT2 > 0) {
          return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "CA10__AWS_Config_Settings__r.has(INCOMPLIANT)", currentStateMessage: "AWS Config is not enabled in all regions.", currentStateReferences: references1.join('\n'), remediation: "Consider configuring AWS Config for all regions.", runtimeError: null};
      }
      var count_CA10__AWS_Config_Settings__r_COMPLIANT4 = 0;
      if (obj.CA10__AWS_Config_Settings__r != null) {
          for (var i5 = 0; i5 < obj.CA10__AWS_Config_Settings__r.length; i5++) {
              if (obj.CA10__AWS_Config_Settings__r[i5].result.status == 'COMPLIANT') {
                  count_CA10__AWS_Config_Settings__r_COMPLIANT4 += 1;
              }
          }
      }
      // condition[2], conditionIndex:[200..299]
      if (count_CA10__AWS_Config_Settings__r_COMPLIANT4 > 0) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "CA10__AWS_Config_Settings__r.has(COMPLIANT)", currentStateMessage: "AWS Config is enabled in all regions.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__AWS_Config_Settings__r_INAPPLICABLE6 = 0;
      if (obj.CA10__AWS_Config_Settings__r != null) {
          for (var i7 = 0; i7 < obj.CA10__AWS_Config_Settings__r.length; i7++) {
              if (obj.CA10__AWS_Config_Settings__r[i7].result.status == 'INAPPLICABLE') {
                  count_CA10__AWS_Config_Settings__r_INAPPLICABLE6 += 1;
              }
          }
      }
      // condition[3], conditionIndex:[300..399]
      if (count_CA10__AWS_Config_Settings__r_INAPPLICABLE6 > 0) {
          return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "CA10__AWS_Config_Settings__r.has(INAPPLICABLE)", currentStateMessage: "The AWS Config doesn't have a recorder configured to include global resource types.", currentStateReferences: references1.join('\n'), remediation: "Ensure that at least one AWS Config Recorder is configured to include global resource types.", runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 400, conditionText: "otherwise", currentStateMessage: "AWS Config is not enabled.", currentStateReferences: references1.join('\n'), remediation: "Consider enabling AWS Config for all regions.", runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__AWS_Config_Settings__r(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__allSupported__c BOOLEAN,
          CA10__recording__c BOOLEAN,
          CA10__lastStatus__c STRING,
          CA10__includeGlobalResourceTypes__c BOOLEAN,
          CA10__account__c STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var IsEmptyLib = new function () {
          this.simpleIsEmpty = function(arg) {
              return arg == null;
          };
          this.simpleIsNotEmpty = function(arg) {
              return arg != null;
          };
      }();
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted from AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      function extract3() { if (!this.out) { this.out = obj.CA10__allSupported__c; } return this.out; };
      function fieldChecked7() {
          if (IsEmptyLib.simpleIsEmpty(obj.CA10__recording__c)) {
              throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "CA10__recording__c.delegatedTo(CA10__recording__c).isEmpty()", currentStateMessage: "Unable to determine Config Recorder status. Possible permission issue with config:DescribeConfigurationRecorderStatus.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10__recording__c;
      }
      function extract6() { if (!this.out) { this.out = fieldChecked7(); } return this.out; };
      function fieldChecked10() {
          if (TextLib.isEmpty(obj.CA10__lastStatus__c)) {
              throw new Error("UNDETERMINED condition:102", {cause: {status: 'UNDETERMINED', conditionIndex: 102, conditionText: "CA10__lastStatus__c.delegatedTo(CA10__lastStatus__c).isEmpty()", currentStateMessage: "Unable to determine Config Recorder status. Possible permission issue with config:DescribeConfigurationRecorderStatus.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return obj.CA10__lastStatus__c;
      }
      function extract9() { if (!this.out) { this.out = fieldChecked10(); } return this.out; };
      references1.push('All Supported [obj.CA10__allSupported__c]: ' + obj.CA10__allSupported__c);
      references1.push('Recording [obj.CA10__recording__c]: ' + obj.CA10__recording__c);
      references1.push('Last Status [obj.CA10__lastStatus__c]: ' + obj.CA10__lastStatus__c);
      try {
          if (extract3.call(extract3) == false || extract6.call(extract6) == false || TextLib.notEqual(extract9.call(extract9), 'SUCCESS')) {
              return {status: 'INCOMPLIANT', conditionIndex: 199, conditionText: "extract('CA10__allSupported__c') == false || extract('CA10__recording__c') == false || extract('CA10__lastStatus__c') != 'SUCCESS'", currentStateMessage: "This AWS Config Recorder is not configured properly.", currentStateReferences: references1.join('\n'), remediation: "Consider reconfiguring the AWS Config Recorder.", runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      // condition[2], conditionIndex:[200..299]
      function extract12() { if (!this.out) { this.out = obj.CA10__includeGlobalResourceTypes__c; } return this.out; };
      references1.push('Include Global Resource Types [obj.CA10__includeGlobalResourceTypes__c]: ' + obj.CA10__includeGlobalResourceTypes__c);
      if (extract12.call(extract12) == true) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "extract('CA10__includeGlobalResourceTypes__c') == true", currentStateMessage: "This AWS Config Recorder is configured to include global resource types.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INAPPLICABLE', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "This AWS Config Recorder is configured properly.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          `CA10__AWS_Config_Settings__r`.arr AS CA10__AWS_Config_Settings__r,
          process_CA10__CaAwsAccount__c(
              STRUCT(
                  sObject.Id AS Id,
                  `CA10__AWS_Config_Settings__r`.arr AS CA10__AWS_Config_Settings__r
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaAwsAccount__c()) AS sObject
      LEFT JOIN (
          SELECT
              sObject.CA10__account__c,
              ARRAY_AGG(
                  STRUCT(
                      sObject.Id AS Id,
                      sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                      sObject.CA10__allSupported__c AS CA10__allSupported__c,
                      sObject.CA10__recording__c AS CA10__recording__c,
                      sObject.CA10__lastStatus__c AS CA10__lastStatus__c,
                      sObject.CA10__includeGlobalResourceTypes__c AS CA10__includeGlobalResourceTypes__c,
                      sObject.CA10__account__c AS CA10__account__c,
                      process_CA10__AWS_Config_Settings__r(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                              sObject.CA10__allSupported__c AS CA10__allSupported__c,
                              sObject.CA10__recording__c AS CA10__recording__c,
                              sObject.CA10__lastStatus__c AS CA10__lastStatus__c,
                              sObject.CA10__includeGlobalResourceTypes__c AS CA10__includeGlobalResourceTypes__c,
                              sObject.CA10__account__c AS CA10__account__c
                          ),
                          sObject.context.snapshotTime
                      ) as result
                  )
              ) AS arr
          FROM UNNEST(mock_CA10__CaAwsConfigRecorder__c()) AS sObject
          GROUP BY sObject.CA10__account__c
      ) AS `CA10__AWS_Config_Settings__r`
          ON sObject.Id = `CA10__AWS_Config_Settings__r`.CA10__account__c
  ) sObject ON sObject.Id = expectedResult.Id;
