---
inputType: "CA10__CaAwsDbInstance__c"
testData:
  - file: test-data.json
importExtracts:
  - file: /types/CA10__CaAwsDbInstance__c/object.extracts.yaml
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "The Instance is not available."
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__status__c"
        right:
          TEXT: "available"
  - status: "INAPPLICABLE"
    currentStateMessage: "This policy doesn't apply to Cluster Instances."
    check:
      NOT_EMPTY:
        arg:
          EXTRACT: "CA10__clusterArn__c"
  - status: "INAPPLICABLE"
    currentStateMessage: "This policy doesn't apply to Neptune."
    check:
      IS_EQUAL:
        left:
          EXTRACT: "CA10__engine__c"
        right:
          TEXT: "neptune"
  - status: "INAPPLICABLE"
    currentStateMessage: "This policy doesn't apply to DocumentDB."
    check:
      IS_EQUAL:
        left:
          EXTRACT: "CA10__engine__c"
        right:
          TEXT: "docdb"          
  - status: "COMPLIANT"
    currentStateMessage: "The RDS Instance Deletion Protection is enabled."
    check: 
      IS_EQUAL:
        left:
          EXTRACT: CA10__deletionProtection__c
        right:
          BOOLEAN: true 
otherwise:
  status: "INCOMPLIANT"
  currentStateMessage: "The RDS Instance Deletion Protection is disabled."
  remediationMessage: "Enable Deletion Protection for this RDS Instance."
