{
  "$schema": "https://intentius.io/chant/schemas/component/v1/component.schema.json",
  "contractVersion": "1.0.0",
  "name": "neo4j-cluster",
  "archetype": "infra",
  "dependsOn": [],
  "deploy": [
    {
      "phase": "Seed",
      "steps": [
        { "kind": "cfn-deploy", "template": "archive:neo4j-az0-0.template.json" },
        { "kind": "code-deploy", "instance": 0, "revision": "@Seed.templateUri" },
        { "kind": "wait-cluster-healthy", "size": 1 }
      ]
    },
    {
      "phase": "Node 1",
      "steps": [
        { "kind": "gate", "signalName": "approve-neo4j-node-1", "description": "Confirm the seed node is healthy before rolling to node 1", "timeout": "24h" },
        { "kind": "cfn-deploy", "template": "archive:neo4j-1.template.json" },
        { "kind": "code-deploy", "instance": 1, "revision": "@Seed.templateUri" },
        { "kind": "wait-cluster-healthy", "quorum": true }
      ]
    },
    {
      "phase": "Node 2",
      "steps": [
        { "kind": "cfn-deploy", "template": "archive:neo4j-2.template.json" },
        { "kind": "code-deploy", "instance": 2, "revision": "@Seed.templateUri" },
        { "kind": "wait-cluster-healthy", "quorum": true }
      ]
    }
  ]
}
