afa53a3362
Align the provider with unkin/terraform-provider-vault-secrets-netbox: the Go module becomes terraform-provider-vault-secrets-ghp, the provider source address vault-secrets-ghp, and the resources ghp_secret_backend / ghp_secret_role (TypeName ghp). - main.go: module import, providerserver Address, package doc comment. - provider.go: TypeName ghp (resources ghp_secret_backend, ghp_secret_role). - Makefile: BINARY + INSTALL_DIR under vault-secrets-ghp; drop the e2e target (netbox has none). - .woodpecker/release: PUT the zip to the artifactapi vault-secrets-ghp path. - Restructure examples to netbox's layout (combined examples/main.tf + per resource) and rewrite README for the new names; drop the Docker e2e harness to mirror netbox exactly. Engine schema mapping is unchanged. gofmt, go vet, go build ./... and go test -race ./... all pass.
46 lines
1.0 KiB
Terraform
46 lines
1.0 KiB
Terraform
terraform {
|
|
required_providers {
|
|
ghp = {
|
|
source = "git.unkin.net/unkin/vault-secrets-ghp"
|
|
version = "0.0.1"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "ghp" {
|
|
# address defaults to $VAULT_ADDR, token to $VAULT_TOKEN
|
|
}
|
|
|
|
variable "ghp_admin_token" {
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
resource "ghp_secret_backend" "ghp" {
|
|
path = "ghp"
|
|
base_url = "https://ghp.unkin.net"
|
|
admin_token = var.ghp_admin_token
|
|
}
|
|
|
|
# Agent role scoped to a ghp App installation for CI.
|
|
resource "ghp_secret_role" "ci" {
|
|
backend = ghp_secret_backend.ghp.path
|
|
name = "ci"
|
|
token_type = "agent"
|
|
installation_id = 12345
|
|
repositories = ["unkin/prodenv"]
|
|
scopes = ["contents:read", "pull_requests:write"]
|
|
ttl = 3600
|
|
max_ttl = 28800
|
|
}
|
|
|
|
# Proxy (OAuth-backed) role, no installation binding.
|
|
resource "ghp_secret_role" "proxy" {
|
|
backend = ghp_secret_backend.ghp.path
|
|
name = "proxy"
|
|
token_type = "proxy"
|
|
scopes = ["contents:read"]
|
|
ttl = 1800
|
|
max_ttl = 14400
|
|
}
|