{
    "additionalProperties": false,
    "description": "Snowplow Redshift storage configuration",
    "properties": {
        "compRows": {
            "description": "Number of rows to be used as the sample size for compression analysis",
            "maximum": 1000000000,
            "minimum": 1000,
            "type": "integer"
        },
        "database": {
            "description": "Redshift database name",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
        },
        "host": {
            "anyOf": [
                {
                    "format": "hostname"
                },
                {
                    "format": "ipv4"
                },
                {
                    "format": "ipv6"
                }
            ],
            "description": "Redshift cluster host ('localhost' for enabled SSH Tunnel)",
            "type": "string"
        },
        "id": {
            "_format": "uuid",
            "description": "Machine-readable unique identificator",
            "type": "string"
        },
        "jdbc": {
            "additionalProperties": false,
            "properties": {
                "BlockingRowsMode": {
                    "description": "The number of rows to hold in memory",
                    "minimum": 0,
                    "type": "integer"
                },
                "DSILogLevel": {
                    "description": "Amount of detail included in log file",
                    "maximum": 6,
                    "minimum": 0,
                    "type": "integer"
                },
                "DisableIsValidQuery": {
                    "description": "Disable detection JDBC driver no longer holding a valid database connection",
                    "type": "boolean"
                },
                "FilterLevel": {
                    "description": "The minimum severity level of a message that the client processes",
                    "enum": [
                        "DEBUG",
                        "INFO",
                        "NOTICE",
                        "WARNING",
                        "LOG",
                        "ERROR"
                    ]
                },
                "TCPKeepAliveMinutes": {
                    "description": "The threshold for minutes of inactivity before initiating a TCP keepalive transmission",
                    "minimum": 0,
                    "type": "integer"
                },
                "loginTimeout": {
                    "description": "The number of seconds to wait before timing out when connecting to the server",
                    "minimum": 0,
                    "type": "integer"
                },
                "loglevel": {
                    "description": "The amount of logging information output by the driver",
                    "maximum": 2,
                    "minimum": 0,
                    "type": [
                        "integer",
                        "null"
                    ]
                },
                "socketTimeout": {
                    "description": "The number of seconds to wait during socket read operations before timing out",
                    "minimum": 0,
                    "type": "integer"
                },
                "ssl": {
                    "description": "Whether to use an SSL connection",
                    "type": "boolean"
                },
                "sslMode": {
                    "description": "Determines how to handle server certificate verification",
                    "enum": [
                        "verify-ca",
                        "verify-full"
                    ],
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "sslRootCert": {
                    "description": "The full path of a .pem or .crt file containing the trust root Certificate Authority",
                    "maxLength": 1024,
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "tcpKeepAlive": {
                    "description": "A value that determines whether TCP keepalives are enabled",
                    "type": "boolean"
                }
            },
            "type": "object"
        },
        "maxError": {
            "description": "Amount of allowed errors before aborting load",
            "maximum": 100000,
            "minimum": 0,
            "type": "integer"
        },
        "name": {
            "description": "Human-readable storage target name, used only for logging",
            "maxLength": 255,
            "type": "string"
        },
        "password": {
            "description": "Redshift password, either plain-text or encrypted key for EC2 Parameter Storage",
            "properties": {
                "ec2ParameterStore": {
                    "description": "EC2 Parameter Storage configuration",
                    "properties": {
                        "parameterName": {
                            "description": "EC2 Parameter with encrypted password",
                            "maxLength": 2048,
                            "type": "string"
                        }
                    },
                    "required": [
                        "parameterName"
                    ],
                    "type": "object"
                }
            },
            "required": [
                "ec2ParameterStore"
            ],
            "type": [
                "string",
                "object"
            ]
        },
        "port": {
            "description": "Redshift database port",
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
        },
        "processingManifest": {
            "description": "Optional processing manifest to maintain pipeline state",
            "properties": {
                "amazonDynamoDb": {
                    "description": "Configuration for processing manifest on top of DynamoDB - single available implementation",
                    "properties": {
                        "tableName": {
                            "description": "DynamoDB table name",
                            "maxLength": 255,
                            "minLength": 3,
                            "type": "string"
                        }
                    },
                    "required": [
                        "tableName"
                    ],
                    "type": "object"
                }
            },
            "required": [
                "amazonDynamoDb"
            ],
            "type": [
                "object",
                "null"
            ]
        },
        "purpose": {
            "description": "Kind of data stored in this instance",
            "enum": [
                "ENRICHED_EVENTS"
            ]
        },
        "roleArn": {
            "description": "IAM Role ARN used to load data from S3",
            "minLength": 20,
            "type": "string"
        },
        "schema": {
            "description": "Redshift database schema (e.g. 'atomic')",
            "maxLength": 128,
            "type": "string"
        },
        "sshTunnel": {
            "description": "Optional SSH Tunnel configuration",
            "properties": {
                "bastion": {
                    "description": "Bastion host configuration",
                    "properties": {
                        "host": {
                            "anyOf": [
                                {
                                    "format": "hostname"
                                },
                                {
                                    "format": "ipv4"
                                },
                                {
                                    "format": "ipv6"
                                }
                            ],
                            "description": "Bastion SSH host",
                            "type": "string"
                        },
                        "key": {
                            "description": "SSH-key stored in EC2 Parameter Storage",
                            "properties": {
                                "ec2ParameterStore": {
                                    "properties": {
                                        "parameterName": {
                                            "maxLength": 2048,
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "parameterName"
                                    ],
                                    "type": "object"
                                }
                            },
                            "required": [
                                "ec2ParameterStore"
                            ],
                            "type": [
                                "object",
                                "null"
                            ]
                        },
                        "passphrase": {
                            "description": "Plain-text SSH user's passphrase",
                            "maxLength": 2048,
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "port": {
                            "description": "Bastion SSH port",
                            "maximum": 65535,
                            "minimum": 1,
                            "type": "integer"
                        },
                        "user": {
                            "description": "SSH user",
                            "maxLength": 32,
                            "type": "string"
                        }
                    },
                    "required": [
                        "host",
                        "port",
                        "user",
                        "passphrase",
                        "key"
                    ],
                    "type": "object"
                },
                "destination": {
                    "description": "Database socket inside private network",
                    "properties": {
                        "host": {
                            "anyOf": [
                                {
                                    "format": "hostname"
                                },
                                {
                                    "format": "ipv4"
                                },
                                {
                                    "format": "ipv6"
                                }
                            ],
                            "description": "Redshift host inside private network (root-level host should be changed to 'localhost')",
                            "type": "string"
                        },
                        "port": {
                            "description": "Redshift port inside private network (root-level 'port' should be changed to be identical to 'localPort')",
                            "maximum": 65535,
                            "minimum": 1,
                            "type": "integer"
                        }
                    },
                    "required": [
                        "host",
                        "port"
                    ],
                    "type": "object"
                },
                "localPort": {
                    "description": "Arbitrary port on node, running Loader (shoul be identical to root-level 'port')",
                    "maximum": 65535,
                    "minimum": 1,
                    "type": "integer"
                }
            },
            "required": [
                "bastion",
                "destination",
                "localPort"
            ],
            "type": [
                "object",
                "null"
            ]
        },
        "username": {
            "description": "Redshift user",
            "maxLength": 128,
            "type": "string"
        }
    },
    "required": [
        "name",
        "id",
        "host",
        "database",
        "port",
        "username",
        "password",
        "schema",
        "sshTunnel",
        "processingManifest",
        "roleArn",
        "maxError",
        "compRows",
        "jdbc",
        "purpose"
    ],
    "self": {
        "format": "jsonschema",
        "name": "redshift_config",
        "vendor": "com.snowplowanalytics.snowplow.storage",
        "version": "3-0-0"
    },
    "type": "object"
}