{
    "$id": "schema.json",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "Schema Definition for Schema-CLI Provider(s)",
    "type": "object",
    "required": [
        "name",
        "description",
        "uri"
    ],
    "properties": {
        "name": {
            "$ref": "#/$defs/name"
        },
        "description": {
            "$ref": "#/$defs/description"
        },
        "uri": {
            "$ref": "#/$defs/uri"
        },
        "runtime": {
            "$ref": "#/$defs/runtime",
            "default": "node14.x"
        },
        "handler": {
            "$ref": "#/$defs/handler",
            "default": "index.handler"
        },
        "type": {
            "$ref": "#/$defs/type",
            "default": "zip"
        },
        "memory": {
            "$ref": "#/$defs/memory",
            "default": 128
        },
        "timeout": {
            "$ref": "#/$defs/timeout",
            "default": 10
        },
        "environment": {
            "$ref": "#/$defs/environment",
            "default": {}
        },
        "tags": {
            "$ref": "#/$defs/tags",
            "default": {
                "Organization": "Cloud-Technology",
                "Environment": "Development",
                "Business-Unit": "Internal Platform Team",
                "Cost-Center": "0",
                "Security-Compliance": "N/A",
                "Usage": "POC"
            }
        }
    },
    "$defs": {
        "name": {
            "description": "Lambda Function Common-Name",
            "type": "string"
        },
        "description": {
            "type": "string",
            "description": "A description of the function"
        },
        "uri": {
            "type": "string",
            "description": "Path to the function's deployment package within the local filesystem",
            "format": "uri-reference",
            "examples": [
                "./development/lambda-service-1"
            ]
        },
        "runtime": {
            "type": "string",
            "description": "Program Runtime Environment",
            "enum": [
                "node14.x",
                "node12.x"
            ]
        },
        "handler": {
            "type": "string",
            "description": "Function entrypoint. Lambda Handler's are strictly set to ensure of consistent architecture(s) & deployable(s)",
            "enum": [
                "index.handler"
            ]
        },
        "type": {
            "type": "string",
            "description": "Function Packaging Type. Defaults and is enforced to Zip",
            "enum": [
                "zip"
            ]
        },
        "memory": {
            "type": "number",
            "description": "Lambda runtime memory allocation. Defaults to 128MB"
        },
        "timeout": {
            "type": "number",
            "description": "Function timeout. Defaults to 10 seconds"
        },
        "environment": {
            "type": "object",
            "description": "Environment variables that are accessible from function code during execution",
            "additionalProperties": {
                "type": "string"
            },
            "patternProperties": {
                "[a-zA-Z][a-zA-Z0-9_]+": {
                    "type": "string"
                }
            }
        },
        "tags": {
            "type": "object",
            "description": "Environment variables that are accessible from function code during execution",
            "additionalProperties": {
                "type": "string"
            },
            "patternProperties": {
                "[a-zA-Z][a-zA-Z0-9_]+": {
                    "type": "string"
                }
            }
        },
        "unique": {
            "type": "array",
            "uniqueItems": true,
            "minItems": 1,
            "items": {
                "type": "string"
            }
        }
    }
}
