{
  "id": "terraform-6",
  "title": "Azure Service Bus Outbound Events / Signal - Capture",
  "description": "Create an Outbound Events configuration with Azure Service Bus to stream capture events.",
  "category": "Outbound Events",
  "lastUpdated": "2026-10-12",
  "terraformProviderDocs": [
    "https://registry.terraform.io/providers/indykite/indykite/latest/docs/resources/event_sink"
  ],
  "relatedGuides": [
    "/guides/guide-terraform",
    "/guides/guide-outbound-events"
  ],
  "commonErrors": [
    {
      "code": "ALREADY_EXISTS",
      "message": "Only one event sink per project",
      "solution": "Delete the existing event sink before creating a new one"
    },
    {
      "code": "INVALID_ARGUMENT",
      "message": "Invalid Azure Service Bus configuration",
      "solution": "Verify the Service Bus namespace URL and shared access key are correct"
    }
  ],
  "summary": "Outbound Events (Signals) push real-time notifications when nodes are captured in your IKG.\nThis configuration sets up event streaming to Azure Service Bus:\n1. Define Azure Service Bus as the event provider.\n2. Route all capture events (upsert and delete) matching specific criteria to your topic.\n3. Filter events by node label and property values (e.g., Car nodes where manufacturer = \"pontiac\").",
  "usecase": "Scenario: You need to react when specific data is captured or deleted in your IKG.\nEach time a node matching your criteria is created, updated, or deleted, an event is sent to your Azure Service Bus topic. This enables:\n- Real-time data synchronization with Azure services.\n- Triggering Azure Functions, Logic Apps, or other Service Bus consumers.\n- Reliable message delivery with Service Bus queuing capabilities.\nNote: Only one Outbound Events configuration can be active per project. The wildcard indykite.audit.capture.* matches all capture event types.",
  "requirements": "- ServiceAccount credentials created in the IndyKite Hub for your organization.\n- IndyKite Terraform provider 0.49.0 or later, the release the example pins in required_providers; the Terraform guide lists the version each feature first appeared in.\n- Application Agent credentials for capturing data via the Capture API.\n- An Azure Service Bus namespace with a topic and subscription configured.",
  "steps": "1. Ensure your Azure Service Bus topic and subscription are configured.\n2. Apply the Terraform configuration with indykite.audit.capture.* eventType.\n3. Capture nodes with the Car label and manufacturer property set to \"pontiac\".\n4. Add more nodes matching the same criteria.\n5. Verify that event messages appear in your Azure Service Bus topic.\n6. Confirm that non-matching nodes do not trigger events.",
  "code": [
    {
      "step": "Step 2",
      "filename": "main.tf",
      "code": "\nterraform {\n  required_providers {\n    indykite = {\n      source  = \"indykite/indykite\"\n      version = \">= 0.49.0\" # or a later release\n    }\n  }\n}\n\n# indykite provider integrates IndyKite platform with Terraform scripting.\n# Provider for now does not support any parameters and all is set within service account credential file.\nprovider \"indykite\" {}\n\nresource \"indykite_event_sink\" \"outbound_event\" {\n  name               = \"outbound-event\"\n  display_name       = \"Outbound Event\"\n  project_id         = \"gid:AAAAAmluZHlraURlgAABDwAAAAA\" # your project GID\n  include_cdc_events = false\n  providers {\n    provider_name = \"provider-name\"\n    azure_service_bus {\n      connection_string   = \"Endpoint=sb://your-namespace.servicebus.windows.net/;SharedAccessKeyName=xxxxx;SharedAccessKey=xxxxxxx\"\n      queue_or_topic_name = \"capture-changes\"\n    }\n  }\n  routes {\n    provider_id     = \"provider-name\"\n    stop_processing = true\n    keys_values_filter {\n      key_value_pairs {\n        key   = \"manufacturer\"\n        value = \"pontiac\"\n      }\n      key_value_pairs {\n        key   = \"captureLabel\"\n        value = \"Car\"\n      }\n      event_type = \"indykite.audit.capture.upsert.node\"\n    }\n    route_display_name = \"Configuration Audit Events\"  }\n}\n"
    },
    {
      "step": "Step 3",
      "description": "Capture the nodes needed for this use case.",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "ingest": {
        "nodes": [
          {
            "external_id": "alice",
            "is_identity": true,
            "type": "Person",
            "properties": [
              {
                "type": "email",
                "value": "alice@email.com"
              },
              {
                "type": "given_name",
                "value": "Alice"
              },
              {
                "type": "last_name",
                "value": "Smith"
              }
            ]
          },
          {
            "external_id": "knightrider",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "knightrider@demo.com"
              },
              {
                "type": "name",
                "value": "Michael Knight"
              }
            ]
          },
          {
            "external_id": "satchmo",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "satchmo@demo.com"
              },
              {
                "type": "name",
                "value": "Louis Armstrong"
              }
            ]
          },
          {
            "external_id": "karel",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "karel@demo.com"
              },
              {
                "type": "name",
                "value": "Karel Plihal"
              }
            ]
          },
          {
            "external_id": "kitt",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Firebird"
              }
            ]
          },
          {
            "external_id": "cadillacv16",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Cadillac"
              },
              {
                "type": "model",
                "value": "V-16"
              }
            ]
          },
          {
            "external_id": "harmonika",
            "type": "Bus",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Ikarus"
              },
              {
                "type": "model",
                "value": "280"
              }
            ]
          },
          {
            "external_id": "listek",
            "type": "Ticket",
            "is_identity": false
          },
          {
            "external_id": "airbook-xyz",
            "type": "Laptop",
            "is_identity": false
          }
        ]
      }
    },
    {
      "step": "Step 4",
      "description": "Capture additional nodes to trigger more events.",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "ingest": {
        "nodes": [
          {
            "external_id": "kitten",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Bonneville"
              }
            ]
          },
          {
            "external_id": "kitty",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Catalina"
              }
            ]
          }
        ]
      }
    }
  ],
  "links": {
    "html": "/terraform/terraform-6",
    "markdown": "/terraform/terraform-6.md",
    "terraformRegistry": "https://registry.terraform.io/providers/indykite/indykite/latest/docs"
  }
}