{
    "description": "Validation Schema for DynamoDb CreateTable requests",
    "properties": {
        "AttributeDefinitions": {
            "items": {
                "properties": {
                    "AttributeName": {
                        "maxLength": 255,
                        "minLength": 1,
                        "type": "string"
                    },
                    "AttributeType": {
                        "enum": [
                            "S",
                            "N",
                            "B"
                        ],
                        "type": "string"
                    }
                },
                "required": [
                    "AttributeName",
                    "AttributeType"
                ],
                "type": "object"
            },
            "minItems": 1,
            "type": "array"
        },
        "GlobalSecondaryIndexes": {
            "items": {
                "properties": {
                    "IndexName": {
                        "maxLength": 255,
                        "minLength": 3,
                        "pattern": "[a-zA-Z0-9_.-]+",
                        "type": "string"
                    },
                    "KeySchema": {
                        "items": {
                            "properties": {
                                "AttributeName": {
                                    "maxLength": 255,
                                    "minLength": 1,
                                    "type": "string"
                                },
                                "KeyType": {
                                    "enum": [
                                        "HASH",
                                        "RANGE"
                                    ],
                                    "type": "string"
                                }
                            },
                            "required": [
                                "AttributeName",
                                "KeyType"
                            ],
                            "type": "object"
                        },
                        "maxItems": 2,
                        "minItems": 1,
                        "type": "array"
                    },
                    "Projection": {
                        "properties": {
                            "NonKeyAttributes": {
                                "items": {
                                    "maxLength": 255,
                                    "minLength": 1,
                                    "type": "string"
                                },
                                "maxItems": 20,
                                "minItems": 1,
                                "type": "array"
                            },
                            "ProjectionType": {
                                "enum": [
                                    "ALL",
                                    "KEYS_ONLY",
                                    "INCLUDE"
                                ],
                                "type": "string"
                            }
                        },
                        "type": "object"
                    },
                    "ProvisionedThroughput": {
                        "properties": {
                            "ReadCapacityUnits": {
                                "minimum": 1,
                                "type": "number"
                            },
                            "WriteCapacityUnits": {
                                "minimum": 1,
                                "type": "number"
                            }
                        },
                        "required": [
                            "ReadCapacityUnits",
                            "WriteCapacityUnits"
                        ],
                        "type": "object"
                    }
                },
                "required": [
                    "IndexName",
                    "KeySchema",
                    "Projection",
                    "ProvisionedThroughput"
                ],
                "type": "object"
            },
            "maxItems": 5,
            "type": "array"
        },
        "KeySchema": {
            "items": {
                "properties": {
                    "AttributeName": {
                        "maxLength": 255,
                        "minLength": 1,
                        "type": "string"
                    },
                    "KeyType": {
                        "enum": [
                            "HASH",
                            "RANGE"
                        ],
                        "type": "string"
                    }
                },
                "required": [
                    "AttributeName",
                    "KeyType"
                ],
                "type": "object"
            },
            "maxItems": 2,
            "minItems": 1,
            "type": "array"
        },
        "LocalSecondaryIndexes": {
            "items": {
                "properties": {
                    "IndexName": {
                        "maxLength": 255,
                        "minLength": 3,
                        "pattern": "[a-zA-Z0-9_.-]+",
                        "type": "string"
                    },
                    "KeySchema": {
                        "items": {
                            "properties": {
                                "AttributeName": {
                                    "maxLength": 255,
                                    "minLength": 1,
                                    "type": "string"
                                },
                                "KeyType": {
                                    "enum": [
                                        "HASH",
                                        "RANGE"
                                    ],
                                    "type": "string"
                                }
                            },
                            "required": [
                                "AttributeName",
                                "KeyType"
                            ],
                            "type": "object"
                        },
                        "maxItems": 2,
                        "minItems": 1,
                        "type": "array"
                    },
                    "Projection": {
                        "properties": {
                            "NonKeyAttributes": {
                                "items": {
                                    "maxLength": 255,
                                    "minLength": 1,
                                    "type": "string"
                                },
                                "maxItems": 20,
                                "minItems": 1,
                                "type": "array"
                            },
                            "ProjectionType": {
                                "enum": [
                                    "ALL",
                                    "KEYS_ONLY",
                                    "INCLUDE"
                                ],
                                "type": "string"
                            }
                        },
                        "type": "object"
                    }
                },
                "required": [
                    "IndexName",
                    "KeySchema",
                    "Projection"
                ],
                "type": "object"
            },
            "maxItems": 5,
            "type": "array"
        },
        "ProvisionedThroughput": {
            "properties": {
                "ReadCapacityUnits": {
                    "minimum": 1,
                    "type": "number"
                },
                "WriteCapacityUnits": {
                    "minimum": 1,
                    "type": "number"
                }
            },
            "required": [
                "ReadCapacityUnits",
                "WriteCapacityUnits"
            ],
            "type": "object"
        },
        "StreamSpecification": {
            "properties": {
                "StreamEnabled": {
                    "type": "boolean"
                },
                "StreamViewType": {
                    "enum": [
                        "NEW_IMAGE",
                        "OLD_IMAGE",
                        "NEW_AND_OLD_IMAGES",
                        "KEYS_ONLY"
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "TableName": {
            "maxLength": 255,
            "minLength": 3,
            "pattern": "[a-zA-Z0-9_.-]+",
            "type": "string"
        }
    },
    "required": [
        "AttributeDefinitions",
        "KeySchema",
        "ProvisionedThroughput",
        "TableName"
    ],
    "title": "DynamoDb CreateTable Schema",
    "type": "object"
}