code: def config_compliance(record):
      """
      author:         jack (jack1902)
      description:    Alert on AWS Config Complaince Change events of NON_COMPLIANT
      testing:        From the Config page (https://console.aws.amazon.com/config/home)
                      ensure recording is turned on. And you have a basic rule you can
                      trigger as compliant or non-compliant.
      """
  
      non_compliance_present = any(
          evaluation["complianceType"] == "NON_COMPLIANT"
          for evaluation in record["requestParameters"]["evaluations"]
      )
  
      if RULES_TO_ALERT_ON:
          # Alert on specific rule names. Useful when some Config Rules are just TOO noisy.
          rule_name = record["additionalEventData"]["configRuleName"]
          result = (
              rule_name in RULES_TO_ALERT_ON and non_compliance_present
          )
      else:
          # Alert on ALL config rules regardless of their name
          result = non_compliance_present
  
      return result
  
imports: from matchers.default import AwsConfigMatcher
  from streamalert.shared.rule import rule
label_desc: Use image node_id 1 for calling a global function with example usage: config_compliance(record) and returns: result