{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/atmos-manifests/latest.json",
  "title": "JSON Schema for Atmos Stack Manifest files. Version 1.0. https://atmos.tools",
  "x-lintel": {
    "source": "https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json",
    "sourceSha256": "2f0322bbb9da8e7e83149432a181d00754000f99230682e80f1037166b31675c"
  },
  "type": "object",
  "properties": {
    "import": {
      "$ref": "#/definitions/import"
    },
    "terraform": {
      "$ref": "#/definitions/terraform"
    },
    "helmfile": {
      "$ref": "#/definitions/helmfile"
    },
    "packer": {
      "$ref": "#/definitions/packer"
    },
    "vars": {
      "$ref": "#/definitions/vars"
    },
    "hooks": {
      "$ref": "#/definitions/hooks"
    },
    "env": {
      "$ref": "#/definitions/env"
    },
    "settings": {
      "$ref": "#/definitions/settings"
    },
    "locals": {
      "$ref": "#/definitions/locals"
    },
    "components": {
      "$ref": "#/definitions/components"
    },
    "overrides": {
      "$ref": "#/definitions/overrides"
    },
    "workflows": {
      "$ref": "#/definitions/workflows"
    },
    "dependencies": {
      "$ref": "#/definitions/dependencies"
    },
    "generate": {
      "$ref": "#/definitions/generate"
    }
  },
  "definitions": {
    "import": {
      "title": "import",
      "description": "Import section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "skip_templates_processing": {
                    "type": "boolean"
                  },
                  "ignore_missing_template_values": {
                    "type": "boolean"
                  },
                  "skip_if_missing": {
                    "type": "boolean"
                  },
                  "context": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "path"
                ]
              }
            ]
          }
        }
      ]
    },
    "components": {
      "title": "components",
      "description": "Components section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "terraform": {
              "$ref": "#/definitions/terraform_components"
            },
            "helmfile": {
              "$ref": "#/definitions/helmfile_components"
            },
            "packer": {
              "$ref": "#/definitions/packer_components"
            }
          },
          "required": []
        }
      ]
    },
    "terraform": {
      "title": "terraform",
      "description": "Terraform section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "hooks": {
              "$ref": "#/definitions/hooks"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "locals": {
              "$ref": "#/definitions/locals"
            },
            "command": {
              "$ref": "#/definitions/command"
            },
            "backend_type": {
              "$ref": "#/definitions/backend_type"
            },
            "backend": {
              "$ref": "#/definitions/backend"
            },
            "remote_state_backend_type": {
              "$ref": "#/definitions/remote_state_backend_type"
            },
            "remote_state_backend": {
              "$ref": "#/definitions/remote_state_backend"
            },
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "providers": {
              "$ref": "#/definitions/providers"
            },
            "dependencies": {
              "$ref": "#/definitions/dependencies"
            },
            "generate": {
              "$ref": "#/definitions/generate"
            }
          },
          "required": []
        }
      ]
    },
    "terraform_components": {
      "title": "terraform_components",
      "description": "Terraform components section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[/a-zA-Z0-9-_{}. ]+$": {
              "$ref": "#/definitions/terraform_component_manifest"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "terraform_component_manifest": {
      "title": "terraform_component_manifest",
      "description": "Terraform component manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "metadata": {
              "$ref": "#/definitions/metadata"
            },
            "component": {
              "$ref": "#/definitions/component"
            },
            "source": {
              "$ref": "#/definitions/source"
            },
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "locals": {
              "$ref": "#/definitions/locals"
            },
            "command": {
              "$ref": "#/definitions/command"
            },
            "backend_type": {
              "$ref": "#/definitions/backend_type"
            },
            "backend": {
              "$ref": "#/definitions/backend"
            },
            "remote_state_backend_type": {
              "$ref": "#/definitions/remote_state_backend_type"
            },
            "remote_state_backend": {
              "$ref": "#/definitions/remote_state_backend"
            },
            "providers": {
              "$ref": "#/definitions/providers"
            },
            "hooks": {
              "$ref": "#/definitions/hooks"
            },
            "provision": {
              "$ref": "#/definitions/provision"
            },
            "dependencies": {
              "$ref": "#/definitions/dependencies"
            },
            "auth": {
              "$ref": "#/definitions/component_auth"
            },
            "generate": {
              "$ref": "#/definitions/generate"
            }
          },
          "required": []
        }
      ]
    },
    "helmfile": {
      "title": "helmfile",
      "description": "Helmfile section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "locals": {
              "$ref": "#/definitions/locals"
            },
            "command": {
              "$ref": "#/definitions/command"
            },
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "dependencies": {
              "$ref": "#/definitions/dependencies"
            }
          },
          "required": []
        }
      ]
    },
    "helmfile_components": {
      "title": "helmfile_components",
      "description": "Helmfile components section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[/a-zA-Z0-9-_{}. ]+$": {
              "$ref": "#/definitions/helmfile_component_manifest"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "helmfile_component_manifest": {
      "title": "helmfile_component_manifest",
      "description": "Helmfile component manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "metadata": {
              "$ref": "#/definitions/metadata"
            },
            "component": {
              "$ref": "#/definitions/component"
            },
            "source": {
              "$ref": "#/definitions/source"
            },
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "locals": {
              "$ref": "#/definitions/locals"
            },
            "command": {
              "$ref": "#/definitions/command"
            },
            "provision": {
              "$ref": "#/definitions/provision"
            },
            "dependencies": {
              "$ref": "#/definitions/dependencies"
            },
            "auth": {
              "$ref": "#/definitions/component_auth"
            }
          },
          "required": []
        }
      ]
    },
    "packer": {
      "title": "packer",
      "description": "Packer section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "locals": {
              "$ref": "#/definitions/locals"
            },
            "command": {
              "$ref": "#/definitions/command"
            },
            "overrides": {
              "$ref": "#/definitions/overrides"
            },
            "dependencies": {
              "$ref": "#/definitions/dependencies"
            }
          },
          "required": []
        }
      ]
    },
    "packer_components": {
      "title": "packer_components",
      "description": "Packer components section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[/a-zA-Z0-9-_{}. ]+$": {
              "$ref": "#/definitions/packer_component_manifest"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "packer_component_manifest": {
      "title": "packer_component_manifest",
      "description": "packer component manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "metadata": {
              "$ref": "#/definitions/metadata"
            },
            "component": {
              "$ref": "#/definitions/component"
            },
            "source": {
              "$ref": "#/definitions/source"
            },
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "locals": {
              "$ref": "#/definitions/locals"
            },
            "command": {
              "$ref": "#/definitions/command"
            },
            "provision": {
              "$ref": "#/definitions/provision"
            },
            "dependencies": {
              "$ref": "#/definitions/dependencies"
            },
            "auth": {
              "$ref": "#/definitions/component_auth"
            }
          },
          "required": []
        }
      ]
    },
    "command": {
      "title": "command",
      "description": "Command to execute",
      "type": "string"
    },
    "component": {
      "title": "component",
      "description": "Component section",
      "type": "string"
    },
    "metadata": {
      "title": "metadata",
      "description": "Metadata section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "abstract",
                "real"
              ]
            },
            "enabled": {
              "type": "boolean",
              "description": "Flag to enable or disable the component"
            },
            "component": {
              "type": "string",
              "description": "Terraform/OpenTofu/Helmfile component"
            },
            "inherits": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "array",
                  "description": "A list of Atmos components that the current component inherits from",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            "terraform_workspace": {
              "type": "string",
              "description": "Terraform workspace"
            },
            "terraform_workspace_pattern": {
              "type": "string",
              "description": "Terraform workspace pattern"
            },
            "custom": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "description": "Custom configuration per component, not inherited by derived components",
                  "additionalProperties": true,
                  "title": "custom"
                }
              ]
            },
            "locked": {
              "type": "boolean",
              "description": "Flag to lock the component and prevent modifications while allowing read operations"
            }
          },
          "required": []
        }
      ]
    },
    "settings": {
      "title": "settings",
      "description": "Settings section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "validation": {
              "$ref": "#/definitions/validation"
            },
            "depends_on": {
              "$ref": "#/definitions/depends_on"
            },
            "spacelift": {
              "$ref": "#/definitions/spacelift"
            },
            "atlantis": {
              "$ref": "#/definitions/atlantis"
            },
            "templates": {
              "$ref": "#/definitions/templates"
            }
          },
          "required": []
        }
      ]
    },
    "validation": {
      "title": "validation",
      "description": "Validation section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[/a-zA-Z0-9-_{}. ]+$": {
              "$ref": "#/definitions/validation_manifest"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "validation_manifest": {
      "title": "validation_manifest",
      "description": "Validation manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "properties": {
            "schema_type": {
              "type": "string",
              "enum": [
                "jsonschema",
                "opa"
              ]
            },
            "schema_path": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "disabled": {
              "type": "boolean"
            },
            "timeout": {
              "type": "integer",
              "minimum": 0
            },
            "module_paths": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              },
              "description": "List of paths to validation modules"
            }
          },
          "additionalProperties": false,
          "required": [
            "schema_type",
            "schema_path"
          ]
        }
      ]
    },
    "vars": {
      "title": "vars",
      "description": "Vars section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "env": {
      "title": "env",
      "description": "Env section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "locals": {
      "title": "locals",
      "description": "Local variables for use within templates. At file level (global, terraform, helmfile, packer sections), locals are file-scoped and do NOT inherit across file imports. At component level, locals inherit from base components via metadata.inherits (or the component field), similar to vars, with component-level locals taking precedence. Locals can reference each other within the same scope.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "backend_type": {
      "title": "backend_type",
      "description": "Backend type",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "string",
          "enum": [
            "local",
            "s3",
            "remote",
            "vault",
            "static",
            "azurerm",
            "gcs",
            "cloud"
          ]
        }
      ]
    },
    "backend": {
      "title": "backend",
      "description": "Backend section",
      "$ref": "#/definitions/backend_manifest"
    },
    "remote_state_backend_type": {
      "title": "remote_state_backend_type",
      "description": "Remote state backend type",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "string",
          "enum": [
            "local",
            "s3",
            "remote",
            "vault",
            "static",
            "azurerm",
            "gcs",
            "cloud"
          ]
        }
      ]
    },
    "remote_state_backend": {
      "title": "remote_state_backend",
      "description": "Remote state backend section",
      "$ref": "#/definitions/backend_manifest"
    },
    "backend_manifest": {
      "title": "backend",
      "description": "Backend manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "local": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "s3": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "remote": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "vault": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "static": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "azurerm": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "gcs": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "cloud": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            }
          },
          "required": []
        }
      ]
    },
    "overrides": {
      "title": "overrides",
      "description": "Overrides section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "command": {
              "$ref": "#/definitions/command"
            },
            "vars": {
              "$ref": "#/definitions/vars"
            },
            "env": {
              "$ref": "#/definitions/env"
            },
            "settings": {
              "$ref": "#/definitions/settings"
            },
            "providers": {
              "$ref": "#/definitions/providers"
            },
            "generate": {
              "$ref": "#/definitions/generate"
            }
          },
          "required": []
        }
      ]
    },
    "depends_on": {
      "title": "depends_on",
      "description": "Depends_on section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[/a-zA-Z0-9-_{}. ]+$": {
              "$ref": "#/definitions/depends_on_manifest"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "depends_on_manifest": {
      "title": "depends_on_manifest",
      "description": "Depends_on manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "properties": {
            "namespace": {
              "type": "string"
            },
            "tenant": {
              "type": "string"
            },
            "environment": {
              "type": "string"
            },
            "stage": {
              "type": "string"
            },
            "component": {
              "type": "string"
            },
            "file": {
              "type": "string"
            },
            "folder": {
              "type": "string"
            }
          },
          "oneOf": [
            {
              "required": [
                "component"
              ]
            },
            {
              "required": [
                "file"
              ]
            },
            {
              "required": [
                "folder"
              ]
            }
          ],
          "additionalProperties": false
        }
      ]
    },
    "spacelift": {
      "title": "spacelift",
      "description": "Spacelift section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "workspace_enabled": {
              "type": "boolean"
            },
            "stack_destructor_enabled": {
              "type": "boolean"
            },
            "protect_from_deletion": {
              "type": "boolean"
            },
            "autodeploy": {
              "type": "boolean"
            },
            "terraform_version": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "required": []
        }
      ]
    },
    "atlantis": {
      "title": "atlantis",
      "description": "Atlantis section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "config_template_name": {
              "type": "string"
            },
            "config_template": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "project_template_name": {
              "type": "string"
            },
            "project_template": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            },
            "workflow_templates": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                }
              ]
            }
          },
          "required": []
        }
      ]
    },
    "workflows": {
      "title": "workflows",
      "description": "Workflows section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            }
          },
          "patternProperties": {
            "^[/a-zA-Z0-9-_{}. ]+$": {
              "$ref": "#/definitions/workflow_manifest"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "workflow_manifest": {
      "title": "workflow_manifest",
      "description": "Workflow manifest",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "description": {
              "type": "string"
            },
            "stack": {
              "type": "string"
            },
            "steps": {
              "oneOf": [
                {
                  "type": "string",
                  "pattern": "^!include"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "command": {
                        "type": "string"
                      },
                      "stack": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "retry": {
                        "$ref": "#/definitions/workflow_retry"
                      },
                      "working_directory": {
                        "type": "string",
                        "description": "Working directory for the workflow step"
                      },
                      "identity": {
                        "type": "string",
                        "description": "Identity to use for the workflow step"
                      },
                      "env": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Environment variables for the workflow step"
                      }
                    },
                    "required": [
                      "command"
                    ]
                  }
                }
              ]
            }
          },
          "required": [
            "steps"
          ]
        }
      ]
    },
    "providers": {
      "title": "providers",
      "description": "Providers section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "templates": {
      "title": "templates",
      "description": "Templates section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "hooks": {
      "title": "hooks",
      "description": "Hooks section",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "generate": {
      "title": "generate",
      "description": "Generate section for declarative file generation. Keys are filenames (must be quoted if containing dots), values are either string templates or objects that will be serialized based on file extension (.json, .yaml, .yml, .tf, .hcl).",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string",
                "description": "String template processed with Go templates"
              },
              {
                "type": "object",
                "description": "Object serialized based on file extension",
                "additionalProperties": true
              }
            ]
          }
        }
      ]
    },
    "provision": {
      "title": "provision",
      "description": "Provision section for component provisioning configuration",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "workdir": {
              "$ref": "#/definitions/provision_workdir"
            }
          },
          "required": []
        }
      ]
    },
    "provision_workdir": {
      "title": "provision_workdir",
      "description": "Workdir provisioner configuration for isolated component execution directories",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Enable isolated working directory for this component"
            }
          },
          "required": []
        }
      ]
    },
    "source": {
      "title": "source",
      "description": "Component source configuration for Just-in-Time (JIT) vendoring. Specifies where to fetch component code from. Supports go-getter compatible URIs.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "string",
          "description": "Go-getter compatible URI with optional version in query string (e.g., 'github.com/org/repo//path?ref=v1.0.0')"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "type": "string",
              "description": "Source type hint for go-getter (e.g., 'git', 's3', 'gcs')"
            },
            "uri": {
              "type": "string",
              "description": "Go-getter compatible URI (e.g., 'github.com/org/repo//path')"
            },
            "version": {
              "type": "string",
              "description": "Version tag, branch, or commit hash to checkout"
            },
            "included_paths": {
              "type": "array",
              "description": "Glob patterns for files to include when vendoring",
              "items": {
                "type": "string"
              }
            },
            "excluded_paths": {
              "type": "array",
              "description": "Glob patterns for files to exclude when vendoring",
              "items": {
                "type": "string"
              }
            },
            "retry": {
              "$ref": "#/definitions/source_retry"
            }
          },
          "required": [
            "uri"
          ]
        }
      ]
    },
    "workflow_retry": {
      "title": "workflow_retry",
      "description": "Retry configuration for workflow steps",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "max_attempts": {
              "type": "integer",
              "minimum": 1,
              "description": "Maximum number of retry attempts"
            },
            "initial_delay": {
              "type": "string",
              "description": "Initial delay between retries (e.g., '1s', '500ms')"
            },
            "max_delay": {
              "type": "string",
              "description": "Maximum delay between retries (e.g., '30s', '1m')"
            },
            "backoff_strategy": {
              "type": "string",
              "enum": [
                "constant",
                "linear",
                "exponential"
              ],
              "description": "Strategy for increasing delay between retries"
            },
            "multiplier": {
              "type": "number",
              "minimum": 1,
              "description": "Multiplier for exponential/linear backoff"
            },
            "random_jitter": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "description": "Random jitter factor (0-1) to add to delays"
            },
            "max_elapsed_time": {
              "type": "string",
              "description": "Maximum total time for all retry attempts (e.g., '5m', '1h')"
            }
          },
          "required": []
        }
      ]
    },
    "source_retry": {
      "title": "source_retry",
      "description": "Retry configuration for source vendoring operations",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "max_attempts": {
              "type": "integer",
              "minimum": 1,
              "description": "Maximum number of retry attempts"
            },
            "initial_delay": {
              "type": "string",
              "description": "Initial delay between retries (e.g., '1s', '500ms')"
            },
            "max_delay": {
              "type": "string",
              "description": "Maximum delay between retries (e.g., '30s', '1m')"
            },
            "backoff_strategy": {
              "type": "string",
              "enum": [
                "constant",
                "linear",
                "exponential"
              ],
              "description": "Strategy for increasing delay between retries"
            },
            "multiplier": {
              "type": "number",
              "minimum": 1,
              "description": "Multiplier for exponential/linear backoff"
            },
            "random_jitter": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "description": "Random jitter factor (0-1) to add to delays"
            },
            "max_elapsed_time": {
              "type": "string",
              "description": "Maximum total time for all retry attempts (e.g., '5m', '1h')"
            }
          },
          "required": []
        }
      ]
    },
    "dependencies": {
      "title": "dependencies",
      "description": "Dependencies section for declaring tool dependencies. Tools specified here will be automatically installed and made available when the component is provisioned.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "tools": {
              "$ref": "#/definitions/dependencies_tools"
            }
          },
          "required": []
        }
      ]
    },
    "dependencies_tools": {
      "title": "dependencies_tools",
      "description": "Tool dependencies with version specifications. Keys are tool names (e.g., 'terraform', 'kubectl', 'k9s') and values are version strings (e.g., '1.9.8', 'latest').",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Tool version (e.g., '1.9.8', '0.32.7', 'latest')"
          }
        }
      ]
    },
    "component_auth": {
      "title": "component_auth",
      "description": "Component-level authentication configuration. Allows overriding or extending global auth providers and identities for specific components.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "needs": {
              "type": "array",
              "description": "List of identity names this component requires. The first identity is primary (sets AWS_PROFILE, etc.). Additional identities have their profiles written to the shared credentials file for multi-account components.",
              "items": {
                "type": "string"
              },
              "uniqueItems": true
            },
            "realm": {
              "type": "string",
              "description": "Credential isolation realm. Different realms provide isolated credentials even for identities with the same name."
            },
            "providers": {
              "$ref": "#/definitions/auth_providers"
            },
            "identities": {
              "$ref": "#/definitions/auth_identities"
            },
            "integrations": {
              "type": "object",
              "description": "Client-only credential materializations (e.g., ECR, EKS).",
              "additionalProperties": true
            }
          },
          "required": []
        }
      ]
    },
    "auth_providers": {
      "title": "auth_providers",
      "description": "Authentication providers configuration. Keys are provider names, values are provider configurations.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9/_-]+$": {
              "$ref": "#/definitions/auth_provider"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "auth_provider": {
      "title": "auth_provider",
      "description": "Authentication provider configuration.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "kind": {
              "type": "string",
              "description": "Provider type (e.g., 'aws/iam-identity-center', 'aws/credentials')"
            },
            "start_url": {
              "type": "string",
              "description": "SSO start URL for AWS IAM Identity Center"
            },
            "url": {
              "type": "string",
              "description": "Provider URL"
            },
            "region": {
              "type": "string",
              "description": "AWS region for the provider"
            },
            "default": {
              "type": "boolean",
              "description": "Whether this is the default provider"
            },
            "session": {
              "$ref": "#/definitions/auth_session"
            },
            "console": {
              "$ref": "#/definitions/auth_console"
            },
            "auto_provision_identities": {
              "type": "boolean",
              "description": "Whether to auto-provision identities when authenticating with this provider"
            },
            "spec": {
              "type": "object",
              "additionalProperties": true,
              "description": "Provider-specific configuration"
            }
          },
          "required": [
            "kind"
          ]
        }
      ]
    },
    "auth_identities": {
      "title": "auth_identities",
      "description": "Authentication identities configuration. Keys are identity names, values are identity configurations.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "patternProperties": {
            "^[a-zA-Z0-9/_-]+$": {
              "$ref": "#/definitions/auth_identity"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "auth_identity": {
      "title": "auth_identity",
      "description": "Authentication identity configuration.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "kind": {
              "type": "string",
              "description": "Identity type (e.g., 'aws/permission-set', 'aws/assume-role')"
            },
            "default": {
              "type": "boolean",
              "description": "Whether this is the default identity"
            },
            "provider": {
              "type": "string",
              "description": "Provider name for direct provider association"
            },
            "via": {
              "$ref": "#/definitions/auth_identity_via"
            },
            "principal": {
              "type": "object",
              "additionalProperties": true,
              "description": "Principal information (role name, account, etc.)",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Principal name (e.g., permission set name, role name)"
                },
                "account": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Account name"
                    },
                    "id": {
                      "type": "string",
                      "description": "Account ID"
                    }
                  }
                }
              }
            },
            "credentials": {
              "type": "object",
              "additionalProperties": true,
              "description": "Static credentials configuration"
            },
            "alias": {
              "type": "string",
              "description": "Alias for the identity"
            },
            "env": {
              "type": "array",
              "description": "Environment variables to set when using this identity",
              "items": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "key",
                  "value"
                ]
              }
            },
            "session": {
              "$ref": "#/definitions/auth_session"
            }
          },
          "required": [
            "kind"
          ]
        }
      ]
    },
    "auth_identity_via": {
      "title": "auth_identity_via",
      "description": "Specifies how an identity connects to a provider or chains from another identity.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "provider": {
              "type": "string",
              "description": "Provider name to authenticate through"
            },
            "identity": {
              "type": "string",
              "description": "Identity name to chain from (for role chaining)"
            }
          }
        }
      ]
    },
    "auth_session": {
      "title": "auth_session",
      "description": "Session configuration for authentication.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "duration": {
              "type": "string",
              "description": "Session duration (e.g., '1h', '12h')"
            }
          }
        }
      ]
    },
    "auth_console": {
      "title": "auth_console",
      "description": "Web console access configuration.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^!include"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "session_duration": {
              "type": "string",
              "description": "Console session duration (e.g., '12h'). Max: 12h for AWS."
            }
          }
        }
      ]
    }
  },
  "additionalProperties": true,
  "oneOf": [
    {
      "required": [
        "workflows"
      ]
    },
    {
      "anyOf": [
        {
          "not": {
            "required": [
              "workflows"
            ]
          },
          "additionalProperties": true
        },
        {
          "required": [
            "import"
          ]
        },
        {
          "required": [
            "terraform"
          ]
        },
        {
          "required": [
            "helmfile"
          ]
        },
        {
          "required": [
            "packer"
          ]
        },
        {
          "required": [
            "vars"
          ]
        },
        {
          "required": [
            "hooks"
          ]
        },
        {
          "required": [
            "env"
          ]
        },
        {
          "required": [
            "settings"
          ]
        },
        {
          "required": [
            "components"
          ]
        },
        {
          "required": [
            "overrides"
          ]
        }
      ]
    }
  ]
}
