官方包 · 自动化与基础设施
实时应用的 Terraform Provider
用代码管理应用、Webhook 和推送通知凭据:允许的来源、客户端事件、历史记录、IP 白名单和密钥轮换,像其他基础设施一样在 plan 中审查。
hibira-io/hibiraTerraform Registry ↗GitHub ↗
- hibira_app、hibira_webhook 和 hibira_push 资源,以及读取现有应用的 data source。
- 可设置宽限期轮换密钥,运行中的服务器不会中断。
- 有人在门户中修改应用时,terraform plan 会显示出差异。
登录后,示例代码会自动填入您的集群主机。 登录
配置
terraform { required_providers { hibira = { source = "hibira-io/hibira" version = "~> 0.1" } } } provider "hibira" {} # reads HIBIRA_API_TOKEN使用
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 完全相同。 免费创建账号 →