{
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "description": "The service type (shoudl always be 's3staticsite')",
            "pattern": "^s3staticsite$",
            "errorMessage": "Must equal 's3staticsite'"
        },
        "path_to_code": {
            "type": "string",
            "errorMessage": "Must be a string"
        },
        "bucket_name": {
            "type": "string",
            "errorMessage": "Must be a string"
        },
        "versioning": {
            "type": "string",
            "description": "The 'versioning' field can be either enabled or disabled",
            "pattern": "^enabled|disabled$",
            "errorMessage": "Must be either 'enabled' or 'disabled'"
        },
        "index_document": {
            "type": "string",
            "errorMessage": "Must be a string"
        },
        "error_document": {
            "type": "string",
            "errorMessage": "Must be a string"
        },
        "cloudfront": {
            "type": "object",
            "properties": {
                "https_certificate": {
                    "type": "string",
                    "errorMessage": "Must be a string"
                },
                "dns_names": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "errorMessage": "Must be a array of strings"
                },
                "price_class": {
                    "oneOf": [
                        {
                            "type": "string",
                            "pattern": "^all$"
                        },
                        {
                            "type": "number",
                            "enum": [
                                100,
                                200
                            ]
                        }
                    ],
                    "errorMessage": "Must be one of 100, 200, or 'all'"
                },
                "logging": {
                    "type": "string",
                    "description": "The 'logging' field can be either enabled or disabled",
                    "pattern": "^enabled|disabled$",
                    "errorMessage": "Must be either 'enabled' or 'disabled'"
                },
                "min_ttl": {
                    "anyOf": [
                        {"type": "number"},
                        {"type": "string"}
                    ],
                    "errorMessage": "Must be a number, or a number written in 'second(s)/minute(s)/hour(s)/day(s)/year'"
                },
                "max_ttl": {
                    "anyOf": [
                        {"type": "number"},
                        {"type": "string"}
                    ],
                    "errorMessage": "Must be a number, or a number written in 'second(s)/minute(s)/hour(s)/day(s)/year'"
                },
                "default_ttl": {
                    "anyOf": [
                        {"type": "number"},
                        {"type": "string"}
                    ],
                    "errorMessage": "Must be a number, or a number written in 'second(s)/minute(s)/hour(s)/day(s)/year'"
                },
                "minimum_https_protocol": {
                    "type": "string",
                    "errorMessage": "Must be a string"
                }
            },
            "additionalProperties": false,
            "errorMessage": {
                "additionalProperties": "Invalid/Unknown property specified"
            }
        },
        "tags": {
            "type": "object",
            "description": "An arbitrary list of key/value pairs to be added as tags to the service",
            "patternProperties": {
                "^.*$": {
                    "anyOf": [
                        {"type": "string"},
                        {"type": "number"}
                    ]
                }
            },
            "errorMessage": "Must contain 1 or more simple key/value pairs where the values are strings or numbers",
            "additionalProperties": false
        }
    },
    "required": [
        "type",
        "path_to_code"
    ],
    "additionalProperties": false,
    "errorMessage": {
        "required": {
            "type": "The 'type' parameter is required",
            "path_to_code": "The 'path_to_code' parameter is required"
        },
        "additionalProperties": "Invalid/Unknown property specified"
    }
}