---
inputType: "CA10__CaAwsDynamoDbTable__c"
importExtracts:
  - file: "/types/CA10__CaAwsDynamoDbTable__c/object.extracts.yaml"
testData:
  - file: 'test-data.json'
conditions:
  - status: "INAPPLICABLE"
    currentStateMessage: "The table is not active."
    check:
      NOT_EQUAL:
        left:
          EXTRACT: "CA10__tableStatus__c"
        right:
          TEXT: "ACTIVE"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in us-west-1 which is more expensive than us-west-2."
    remediationMessage: "Consider migrating the table to us-west-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "us-west-1"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in ca-west-1 which is more expensive than us-west-2."
    remediationMessage: "Consider migrating the table to us-west-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "ca-west-1"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in ap-northeast-1 which is more expensive than ap-northeast-2."
    remediationMessage: "Consider migrating the table to ap-northeast-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "ap-northeast-1"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in ap-northeast-3 which is more expensive than ap-northeast-2."
    remediationMessage: "Consider migrating the table to ap-northeast-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "ap-northeast-3"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in ca-central-1 which is more expensive than us-east-2."
    remediationMessage: "Consider migrating the table to us-east-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "ca-central-1"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in eu-central-1 which is more expensive than eu-west-1, eu-north-1, or eu-south-2."
    remediationMessage: "Consider migrating the table to eu-west-1, eu-north-1, or eu-south-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "eu-central-1"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in eu-west-2 which is more expensive than eu-west-1, eu-north-1, or eu-south-2."
    remediationMessage: "Consider migrating the table to eu-west-1, eu-north-1, or eu-south-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "eu-west-2"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in eu-south-1 which is more expensive than eu-west-1, eu-north-1, or eu-south-2."
    remediationMessage: "Consider migrating the table to eu-west-1, eu-north-1, or eu-south-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "eu-south-1"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in eu-west-3 which is more expensive than eu-west-1, eu-north-1, or eu-south-2."
    remediationMessage: "Consider migrating the table to eu-west-1, eu-north-1, or eu-south-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "eu-west-3"
  - status: "INCOMPLIANT"
    currentStateMessage: "The table is running in eu-central-2 which is more expensive than eu-west-1, eu-north-1, or eu-south-2."
    remediationMessage: "Consider migrating the table to eu-west-1, eu-north-1, or eu-south-2."
    check:
      IS_EQUAL:
        left:
          EXTRACT: CA10__regionName2__c
        right:
          TEXT: "eu-central-2"
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "The EC2 table is located in a cost-effective region."
