---
inputType: "CA10__CaAwsEcsService__c"
testData:
  - file: "test-data.json"
importExtracts:
  - file: "/types/CA10__CaAwsEcsService__c/object.extracts.yaml"
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "The Service is not active."
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__status__c"
        right:
          TEXT: "ACTIVE"
  - status: "INAPPLICABLE"
    currentStateMessage: "The ECS Service does not use Fargate launch type."
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__launchType__c"
        right:
          TEXT: "FARGATE"
  - status: "INCOMPLIANT"
    currentStateMessage: "The ECS Fargate Service is using the outdated platform version 1.3.0."
    remediationMessage: "Update the service to use platform version 1.4.0 or LATEST."
    check:
      IS_EQUAL:
        left:
          EXTRACT: "CA10__platformVersion__c"
        right:
          TEXT: "1.3.0"
  - status: "COMPLIANT"
    currentStateMessage: "The ECS Fargate Service is using a recent platform version."
    check:
      IS_EQUAL:
        left:
          EXTRACT: "CA10__platformVersion__c"
        right:
          TEXT: "LATEST"
  - status: "COMPLIANT"
    currentStateMessage: "The ECS Fargate Service is using a recent platform version."
    check:
      IS_EQUAL:
        left:
          EXTRACT: "CA10__platformVersion__c"
        right:
          TEXT: "1.4.0"
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "The newer version of the ECS Fargate Service."
