---
inputType: "CA10__CaAwsWorkspace__c"
testData:
  - file: "test-data.json"
importExtracts:
  - file: "/types/CA10__CaAwsWorkspace__c/object.extracts.yaml"
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "The WorkSpace is in transient state."
    check:
      AND:
        args:
          - NOT_EQUAL:
              left:
                EXTRACT: "CA10__state__c"
              right:
                TEXT: "AVAILABLE"
          - NOT_EQUAL:
              left:
                EXTRACT: "CA10__state__c"
              right:
                TEXT: "STOPPED"
  - status: "INCOMPLIANT"
    currentStateMessage: "The last user connection time for the WorkSpace is unknown."
    remediationMessage: "Consider terminating the unused WorkSpace."
    check:
      IS_EMPTY:
        arg:
          EXTRACT: "CA10__lastKnownUserConnectionTimestamp__c"
  - status: "INCOMPLIANT"
    currentStateMessage: "The WorkSpace has not been used in the last 30 days."
    remediationMessage: "Consider terminating the unused WorkSpace."
    check:
      IS_BEYOND_LAST_DAYS:
        offsetDays: 30
        arg:
          EXTRACT: "CA10__lastKnownUserConnectionTimestamp__c"
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "The WorkSpace has been used within the last 30 days."