{
  "handlers" : {
    "read" : {
      "permissions" : [ "cassandra:Select" ]
    },
    "create" : {
      "permissions" : [ "cassandra:Create", "cassandra:Select", "cassandra:TagResource", "kms:CreateGrant", "kms:DescribeKey", "kms:Encrypt", "kms:Decrypt" ]
    },
    "update" : {
      "permissions" : [ "cassandra:Alter", "cassandra:Select", "cassandra:TagResource", "cassandra:UntagResource", "kms:CreateGrant", "kms:DescribeKey", "kms:Encrypt", "kms:Decrypt" ]
    },
    "list" : {
      "permissions" : [ "cassandra:Select" ]
    },
    "delete" : {
      "permissions" : [ "cassandra:Drop", "cassandra:Select" ]
    }
  },
  "typeName" : "AWS::Cassandra::Table",
  "description" : "Resource schema for AWS::Cassandra::Table",
  "createOnlyProperties" : [ "/properties/KeyspaceName", "/properties/TableName", "/properties/PartitionKeyColumns", "/properties/ClusteringKeyColumns" ],
  "additionalProperties" : false,
  "primaryIdentifier" : [ "/properties/KeyspaceName", "/properties/TableName" ],
  "definitions" : {
    "EncryptionType" : {
      "default" : "AWS_OWNED_KMS_KEY",
      "description" : "Server-side encryption type",
      "type" : "string",
      "enum" : [ "AWS_OWNED_KMS_KEY", "CUSTOMER_MANAGED_KMS_KEY" ]
    },
    "KmsKeyIdentifier" : {
      "description" : "The AWS KMS customer master key (CMK) that should be used for the AWS KMS encryption. To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. ",
      "type" : "string"
    },
    "Column" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "ColumnName" : {
          "pattern" : "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$",
          "type" : "string"
        },
        "ColumnType" : {
          "type" : "string"
        }
      },
      "required" : [ "ColumnName", "ColumnType" ]
    },
    "ClusteringKeyColumn" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "OrderBy" : {
          "default" : "ASC",
          "type" : "string",
          "enum" : [ "ASC", "DESC" ]
        },
        "Column" : {
          "$ref" : "#/definitions/Column"
        }
      },
      "required" : [ "Column" ]
    },
    "Mode" : {
      "default" : "ON_DEMAND",
      "description" : "Capacity mode for the specified table",
      "type" : "string",
      "enum" : [ "PROVISIONED", "ON_DEMAND" ]
    },
    "BillingMode" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Mode" : {
          "$ref" : "#/definitions/Mode"
        },
        "ProvisionedThroughput" : {
          "$ref" : "#/definitions/ProvisionedThroughput"
        }
      },
      "required" : [ "Mode" ]
    },
    "ProvisionedThroughput" : {
      "description" : "Throughput for the specified table, which consists of values for ReadCapacityUnits and WriteCapacityUnits",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "WriteCapacityUnits" : {
          "type" : "integer",
          "minimum" : 1
        },
        "ReadCapacityUnits" : {
          "type" : "integer",
          "minimum" : 1
        }
      },
      "required" : [ "ReadCapacityUnits", "WriteCapacityUnits" ]
    },
    "Tag" : {
      "description" : "A key-value pair to apply to the resource",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Value" : {
          "minLength" : 1,
          "type" : "string",
          "maxLength" : 256
        },
        "Key" : {
          "minLength" : 1,
          "type" : "string",
          "maxLength" : 128
        }
      },
      "required" : [ "Value", "Key" ]
    },
    "EncryptionSpecification" : {
      "description" : "Represents the settings used to enable server-side encryption",
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "EncryptionType" : {
          "$ref" : "#/definitions/EncryptionType"
        },
        "KmsKeyIdentifier" : {
          "$ref" : "#/definitions/KmsKeyIdentifier"
        }
      },
      "required" : [ "EncryptionType" ]
    }
  },
  "properties" : {
    "TableName" : {
      "pattern" : "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$",
      "description" : "Name for Cassandra table",
      "type" : "string"
    },
    "PointInTimeRecoveryEnabled" : {
      "description" : "Indicates whether point in time recovery is enabled (true) or disabled (false) on the table",
      "type" : "boolean"
    },
    "ClusteringKeyColumns" : {
      "uniqueItems" : true,
      "description" : "Clustering key columns of the table",
      "insertionOrder" : true,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/ClusteringKeyColumn"
      }
    },
    "PartitionKeyColumns" : {
      "minItems" : 1,
      "uniqueItems" : true,
      "description" : "Partition key columns of the table",
      "insertionOrder" : true,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Column"
      }
    },
    "BillingMode" : {
      "$ref" : "#/definitions/BillingMode"
    },
    "DefaultTimeToLive" : {
      "description" : "Default TTL (Time To Live) in seconds, where zero is disabled. If the value is greater than zero, TTL is enabled for the entire table and an expiration timestamp is added to each column.",
      "type" : "integer",
      "minimum" : 0
    },
    "KeyspaceName" : {
      "pattern" : "^[a-zA-Z0-9][a-zA-Z0-9_]{1,47}$",
      "description" : "Name for Cassandra keyspace",
      "type" : "string"
    },
    "EncryptionSpecification" : {
      "$ref" : "#/definitions/EncryptionSpecification"
    },
    "RegularColumns" : {
      "uniqueItems" : true,
      "description" : "Non-key columns of the table",
      "insertionOrder" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Column"
      }
    },
    "Tags" : {
      "minItems" : 0,
      "maxItems" : 50,
      "uniqueItems" : true,
      "description" : "An array of key-value pairs to apply to this resource",
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "required" : [ "KeyspaceName", "PartitionKeyColumns" ]
}