{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.connectsoft.ai/reference/schemas/blueprint-infrastructure.schema.json",
  "title": "Infrastructure Blueprint (blueprint-infrastructure-v1)",
  "description": "Descriptor document of the Infrastructure Blueprint kind (BC-02). Validated by BlueprintService; metadata per blueprint-common.schema.json; generation outputs and validation rules per model/blueprints.yaml.",
  "type": "object",
  "required": [
    "metadata",
    "iac",
    "topology",
    "region",
    "resources",
    "environments"
  ],
  "additionalProperties": false,
  "properties": {
    "metadata": {
      "$ref": "blueprint-common.schema.json#/$defs/Metadata"
    },
    "iac": {
      "type": "object",
      "required": [
        "tool",
        "programPath"
      ],
      "properties": {
        "tool": {
          "enum": [
            "pulumi"
          ]
        },
        "programPath": {
          "type": "string"
        },
        "stacks": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "topology": {
      "enum": [
        "saas-default",
        "hybrid",
        "on-prem",
        "hybrid-compute"
      ]
    },
    "region": {
      "type": "string"
    },
    "resources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "kind"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "storeId": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "environments": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "class"
        ],
        "properties": {
          "class": {
            "enum": [
              "development",
              "test",
              "staging",
              "production"
            ]
          },
          "approvalRequired": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
