function evaluateCompliance()

in governance/3-custom-rules/src/generic-by-params.js [61:70]


function evaluateCompliance(configurationItem, ruleParameters) {
  // Checks for proper resource type
  if (!ruleParameters.resourceTypesArray.includes(configurationItem.resourceType)) {
    return 'NOT_APPLICABLE';
  // Checks for matching path and allowed values
  } else if (ruleParameters.acceptedValues.includes(resolve(ruleParameters.keyPath, configurationItem.configuration))) {
    return 'COMPLIANT';
  }
  return 'NON_COMPLIANT';
}