{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--parameters.json",
  "title": "Parameters",
  "description": "CFN template JSON specification for using template parameters",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/components/parameters.json",
    "sourceSha256": "e0803b92a45d2e659fe9d4730fc01e3fbe70ee4809965126f5ddd48fa864a918"
  },
  "type": "object",
  "properties": {
    "Parameters": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          {
            "$ref": "#/$defs/StringParam"
          },
          {
            "$ref": "#/$defs/StringLikeParam"
          },
          {
            "$ref": "#/$defs/NumberParam"
          },
          {
            "$ref": "#/$defs/CommaDelimitedList"
          },
          {
            "$ref": "#/$defs/StringLikeList"
          },
          {
            "$ref": "#/$defs/NumberList"
          }
        ]
      }
    }
  },
  "$defs": {
    "CommonParams": {
      "properties": {
        "Description": {
          "type": "string",
          "maxLength": 4000
        },
        "NoEcho": {
          "type": "boolean"
        },
        "ConstraintDescription": {
          "type": "string",
          "maxLength": 4000
        }
      }
    },
    "StringParamCommon": {
      "allOf": [
        {
          "properties": {
            "Default": {
              "type": "string"
            },
            "AllowedValues": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1
            }
          }
        },
        {
          "$ref": "#/$defs/CommonParams"
        }
      ]
    },
    "StringParam": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "Type": {
              "enum": [
                "String"
              ]
            },
            "AllowedPattern": {
              "type": "string"
            },
            "MaxLength": {
              "type": "integer",
              "minimum": 1
            },
            "MinLength": {
              "type": "integer",
              "minimum": 1
            }
          },
          "required": [
            "Type"
          ]
        },
        {
          "$ref": "#/$defs/StringParamCommon"
        }
      ]
    },
    "StringLikeParam": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "Type": {
              "enum": [
                "AWS::EC2::AvailabilityZone::Name",
                "AWS::EC2::Image::Id",
                "AWS::EC2::Instance::Id",
                "AWS::EC2::SecurityGroup::GroupName",
                "AWS::EC2::SecurityGroup::Id",
                "AWS::EC2::Subnet::Id",
                "AWS::EC2::Volume::Id",
                "AWS::EC2::VPC::Id",
                "AWS::Route53::HostedZone::Id",
                "AWS::EC2::KeyPair::KeyName",
                "AWS::SSM::Parameter::Value<AWS::EC2::AvailabilityZone::Name>",
                "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
                "AWS::SSM::Parameter::Value<AWS::EC2::Instance::Id>",
                "AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::GroupName>",
                "AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>",
                "AWS::SSM::Parameter::Value<AWS::EC2::Subnet::Id>",
                "AWS::SSM::Parameter::Value<AWS::EC2::Volume::Id>",
                "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
                "AWS::SSM::Parameter::Value<AWS::Route53::HostedZone::Id>",
                "AWS::SSM::Parameter::Value<AWS::EC2::KeyPair::KeyName>"
              ]
            }
          },
          "required": [
            "Type"
          ]
        },
        {
          "$ref": "#/$defs/StringParamCommon"
        }
      ]
    },
    "NumberParam": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "Type": {
              "enum": [
                "Number"
              ]
            },
            "Default": {
              "type": "integer"
            },
            "AllowedValues": {
              "type": "array",
              "items": {
                "type": "integer"
              },
              "minItems": 1
            }
          },
          "required": [
            "Type"
          ]
        },
        {
          "$ref": "#/$defs/CommonParams"
        }
      ]
    },
    "CommaDelimitedList": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "Type": {
              "enum": [
                "CommaDelimitedList",
                "AWS::SSM::Parameter::Value<CommaDelimitedList>"
              ]
            },
            "Default": {
              "type": "string"
            }
          },
          "required": [
            "Type"
          ]
        },
        {
          "$ref": "#/$defs/CommonParams"
        }
      ]
    },
    "StringLikeList": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "Type": {
              "enum": [
                "List<AWS::EC2::AvailabilityZone::Name>",
                "List<AWS::EC2::Image::Id>",
                "List<AWS::EC2::Instance::Id>",
                "List<AWS::EC2::SecurityGroup::GroupName>",
                "List<AWS::EC2::SecurityGroup::Id>",
                "List<AWS::EC2::Subnet::Id>",
                "List<AWS::EC2::Volume::Id>",
                "List<AWS::EC2::VPC::Id>",
                "List<AWS::Route53::HostedZone::Id>",
                "AWS::SSM::Parameter::Value<List<String>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::AvailabilityZone::Name>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::Image::Id>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::Instance::Id>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::SecurityGroup::GroupName>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::SecurityGroup::Id>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::Subnet::Id>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::Volume::Id>>",
                "AWS::SSM::Parameter::Value<List<AWS::EC2::VPC::Id>>",
                "AWS::SSM::Parameter::Value<List<AWS::Route53::HostedZone::Id>>"
              ]
            },
            "Default": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1
            }
          }
        },
        {
          "$ref": "#/$defs/CommonParams"
        }
      ]
    },
    "NumberList": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "Type": {
              "enum": [
                "List<Number>",
                "AWS::SSM::Parameter::Value<List<Integer>>"
              ]
            },
            "Default": {
              "type": "array",
              "items": {
                "type": "integer"
              },
              "minItems": 1
            }
          },
          "required": [
            "Type"
          ]
        },
        {
          "$ref": "#/$defs/CommonParams"
        }
      ]
    }
  }
}
