官方套件 · 自動化與基礎架構

即時應用程式的 Terraform Provider

用程式碼管理應用程式、Webhook 與推播通知憑證:允許的來源、用戶端事件、歷史記錄、IP 允許清單與密鑰輪替,像其他基礎架構一樣在 plan 中審查。

  • hibira_app、hibira_webhook 與 hibira_push 資源,以及讀取既有應用程式的 data source。
  • 可設定寬限期輪替密鑰,執行中的伺服器不會中斷。
  • 有人在入口網站修改應用程式時,terraform plan 會顯示出差異。

登入後,範例程式碼會自動帶入您的叢集主機。 登入

  1. 設定

    terraform {
      required_providers {
        hibira = {
          source  = "hibira-io/hibira"
          version = "~> 0.1"
        }
      }
    }
    
    provider "hibira" {} # reads HIBIRA_API_TOKEN
  2. 使用

    resource "hibira_app" "chat" {
      name            = "chat-prod"
      client_events   = true
      allowed_origins = ["https://example.com"]
    }
    
    resource "hibira_webhook" "presence" {
      app_id = hibira_app.chat.id
      url    = "https://example.com/hooks/hibira"
      events = ["member_added", "member_removed"]
    }

開始之前

  • 在入口網站的 API 權杖頁面建立具讀寫權限的權杖,設定為 HIBIRA_API_TOKEN。
  • 密鑰只在建立應用程式時回傳一次:請用 terraform output -raw 讀取。Free 方案只有 1 個應用程式,且需要列出每個來源。

請使用儀表板中的應用程式 Key;Secret 只放在你的伺服器上。頻道、事件與授權端點的用法和 Pusher 完全相同。 免費建立帳號 →