個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Terraform provider for Hakopod projects, applications and virtual networks
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Manages Hakopod projects, applications and virtual networks with Terraform. It uses the same application and network TOML as the Hakopod CLI and dashboard, and the server validates and deploys it the same way.
Status: pre-1.0. Resource schemas may change between minor versions.
Resources follow Hakopod's model, project → applications → services, with virtual networks between applications:檢視完整 README ↗Manages Hakopod projects, applications and virtual networks with Terraform. It uses the same application and network TOML as the Hakopod CLI and dashboard, and the server validates and deploys it the same way.
Status: pre-1.0. Resource schemas may change between minor versions.
Resources follow Hakopod's model, project → applications → services, with virtual networks between applications:
hakopod_project — a project and its environments. Environments can be added, not removed. A destroyed project's name cannot be reused.hakopod_application — an application and all its services, from TOML (config) or JSON (spec). Create and update deploy it as one revision. Services are not separate resources.hakopod_virtual_network — a virtual network and its segment grants. Needs a project administrator.hakopod_secret — a project, environment or application secret, either a literal value or one the server generates. Values are write-only; value_version changes on rotation, so an application that reads the secret can redeploy.hakopod_clickhouse_access_profile — enable tenant administration on an existing standalone ClickHouse database. Removing this resource preserves its privileges.Full documentation is on the Terraform Registry, and in docs/ in this repository.
The provider is published on the Terraform Registry as hakopod/hakopod. Pin it in your configuration:
terraform {
required_providers {
hakopod = {
source = "hakopod/hakopod"
version = "~> 0.1"
}
}
}
Then download it:
terraform init
The provider reads two environment variables, the same ones the Hakopod CLI uses, so a shell configured for the CLI needs no provider block:
HAKOPOD_API_URL — the Hakopod API URL, or the provider's url attribute.HAKOPOD_API_KEY — a Hakopod API key, or the provider's api_key attribute.Hakopod Cloud also reads HAKOPOD_WORKSPACE (or workspace); leave it unset for self-hosted installations.
provider "hakopod" {} # reads HAKOPOD_API_URL and HAKOPOD_API_KEY
resource "hakopod_project" "commerce" {
name = "commerce"
environments = ["production"]
}
resource "hakopod_virtual_network" "commerce" {
project = hakopod_project.commerce.name
environment = hakopod_project.commerce.environments[0]
config = file("network.toml")
}
resource "hakopod_application" "catalog" {
project = hakopod_project.commerce.name
environment = hakopod_project.commerce.environments[0]
config = templatefile("catalog/hakopod.toml.tftpl", {
network = hakopod_virtual_network.commerce.name # orders catalog after the network
})
}
References order everything: project, then network, then applications; destroy runs in reverse. No depends_on is needed.
| Example | What it shows |
|---|---|
| tree | A project, a network and two applications — one in HCL, one in TOML. |
| static-site | The smallest useful configuration: one public application, no network. |
| full-stack | web, api, worker, scheduler, PostgreSQL and Redis on one network with three segments, generated secrets and persistent volumes. |
| microservices | Five services generated from one map, with ingress derived from who calls whom. |
| multi-environment | One module instantiated per environment, sized differently in each. |
| from-cli-tree | A directory tree of hakopod.toml files deployed as-is, matching hakopod deploy --dir. |
Use the registry release above to use the provider. This section is for working on the provider's own source, where Terraform has to run a locally built binary instead of a published one.
Requires Go (version in go.mod) and Terraform 1.x.
go install .
This installs terraform-provider-hakopod into $(go env GOPATH)/bin. Point Terraform at it with ~/.terraformrc:
provider_installation {
dev_overrides {
"hakopod/hakopod" = "/Users/you/go/bin" # output of: go env GOPATH, plus /bin
}
direct {}
}
With dev_overrides, skip terraform init and run terraform plan directly. Terraform prints a warning that overrides are active.
Tests:
go test ./...
Releases are built by GoReleaser from .github/workflows/release.yml when a v* tag is pushed. The Terraform Registry requires the checksum file to be signed.
The signing key and the repository secrets are already in place; publishing a new version is only the tag:
git tag v0.2.0
git push origin v0.2.0
To set this up again from scratch, or to rotate the key:
GPG_PRIVATE_KEY (ASCII-armored private key) and PASSPHRASE.The workflow publishes zip archives for each OS/architecture, a SHA256SUMS file, its signature and the registry manifest to a GitHub release, which the Registry picks up.
Apache License 2.0. See LICENSE.