---
inputType: "CA10__CaAwsDbCluster__c"
testData:
  - file: test-data.json
importExtracts:
  - file: /types/CA10__CaAwsDbCluster__c/object.extracts.yaml
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "The Cluster is not available."
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__status__c"
        right:
          TEXT: "available"
  - status: "INAPPLICABLE"
    currentStateMessage: "IAM database authentication works only with Aurora MySQL, and Aurora PostgreSQL."
    check:
      NOT:
        arg:
          CONTAINS:
            arg:
              SET:
                itemType: "TEXT"
                items:
                  - "aurora-postgresql"
                  - "aurora-mysql"
            search:
              EXTRACT: "CA10__engine__c"
  - status: "COMPLIANT"
    currentStateMessage: "IAM Database Authentication is enabled for this RDS Cluster."
    check:
      IS_EQUAL:
        left:
          EXTRACT: "CA10__iamDatabaseAuthenticationEnabled__c"
        right:
          BOOLEAN: true
otherwise:
  status: "INCOMPLIANT"
  currentStateMessage: "IAM Database Authentication is disabled for this RDS Cluster."
  remediationMessage: "Enable IAM Database Authentication for the RDS Cluster."