{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/landing-zone-accelerator-on-aws-replacements-config/latest.json",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/awslabs/landing-zone-accelerator-on-aws/main/source/packages/@aws-accelerator/config/lib/schemas/replacements-config.json",
    "sourceSha256": "df6661e50eb1a68edf5ed1f9886b2bfc980f848d9a63218c95ba9151e283ad01",
    "fileMatch": [
      "replacements-config.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "$ref": "#/$defs/IReplacementsConfig",
  "$defs": {
    "IParameterReplacement": {
      "type": "object",
      "description": "Fixed replacement value to apply throughout config files. Loaded from SSM\nparameters in the management account in the HOME_REGION.",
      "properties": {
        "key": {
          "$ref": "#/$defs/NonEmptyString",
          "description": "Key of the replacement placeholder"
        },
        "path": {
          "$ref": "#/$defs/NonEmptyString",
          "description": "Path of the SSM Parameter containing the value to replace"
        }
      },
      "required": [
        "key",
        "path"
      ],
      "additionalProperties": false
    },
    "IParameterReplacementV2": {
      "type": "object",
      "description": "Fixed replacement value to apply throughout config files. Loaded from SSM\nparameters in the management account in the HOME_REGION.",
      "properties": {
        "key": {
          "$ref": "#/$defs/NonEmptyString",
          "description": "Key of the replacement placeholder"
        },
        "path": {
          "$ref": "#/$defs/NonEmptyString",
          "description": "Path of the SSM Parameter containing the value to replace"
        },
        "type": {
          "$ref": "#/$defs/ParameterReplacementType",
          "description": "Type of the global parameters"
        },
        "value": {
          "anyOf": [
            {
              "$ref": "#/$defs/NonEmptyString"
            },
            {
              "items": {
                "$ref": "#/$defs/NonEmptyString"
              },
              "type": "array"
            },
            {
              "type": "number"
            }
          ],
          "description": "Value of the parameter if type is string or array"
        }
      },
      "required": [
        "key",
        "type"
      ],
      "additionalProperties": false
    },
    "IReplacementsConfig": {
      "additionalProperties": false,
      "description": "Accelerator replacements configuration",
      "properties": {
        "globalReplacements": {
          "description": "The set of placeholder parameters (key/path pairs) that will be merged with yaml configuration files.",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/IParameterReplacement"
              },
              {
                "$ref": "#/$defs/IParameterReplacementV2"
              }
            ]
          },
          "type": "array"
        }
      },
      "type": "object",
      "patternProperties": {
        "^\\.": {
          "description": "YAML anchor"
        }
      }
    },
    "NonEmptyString": {
      "description": "## Non-Empty String Type\n\nRepresents a string that must contain at least one character. Used for required text fields throughout the Landing Zone Accelerator configuration where empty values are not permitted.\n\n```",
      "minLength": 1,
      "type": "string"
    },
    "ParameterReplacementType": {
      "description": "## Parameter Replacement Type\n\nDefines the types of parameter replacement mechanisms supported in configuration templates and CloudFormation deployments.\n\n### Values\n- **SSM**: AWS Systems Manager Parameter Store values\n- **String**: Simple string replacement\n- **StringList**: Comma-separated list of strings\n- **Number**: Numeric value replacement\n\n### Use Cases\n- **SSM**: Dynamic configuration values, secrets, cross-stack references\n- **String**: Static configuration values, environment names\n- **StringList**: Multiple values like subnet IDs, security group IDs\n- **Number**: Port numbers, counts, numeric thresholds",
      "enum": [
        "SSM",
        "String",
        "StringList",
        "Number"
      ],
      "type": "string"
    }
  }
}
