Skip to content

entrepot_repository_signing_key

Imports your own OpenPGP private key as the signing key of a hosted apt or yum repository (by default the server generates one on first use). The repository metadata is re-signed with the imported key.

Drift: the private key is write-only. The provider computes the key’s fingerprint locally and compares it with the server’s active key on every refresh; if the key was rotated or replaced outside Terraform, the plan shows a fingerprint change and applying it imports the configured key again.

Destroy rotates the key: the server replaces the imported key with a freshly generated one (a repository always has a signing key), so clients must fetch the new public key.

The private key (and passphrase) are stored in the Terraform state; protect it accordingly.

resource "entrepot_repository" "apt" {
name = "apt-internal"
format = "apt"
kind = "hosted"
blob_store = "default"
}
# Sign the repository with your own key instead of a server-generated one:
# gpg --armor --export-secret-keys <key-id> > signing-key.asc
resource "entrepot_repository_signing_key" "apt" {
repository = entrepot_repository.apt.name
private_key = file("${path.module}/signing-key.asc")
passphrase = var.signing_key_passphrase
}
variable "signing_key_passphrase" {
type = string
sensitive = true
default = null
}
output "apt_key_fingerprint" {
value = entrepot_repository_signing_key.apt.fingerprint
}
  • private_key (String, Sensitive) ASCII-armored OpenPGP private key (gpg --armor --export-secret-keys <id>) containing exactly one key with a usable signing (sub)key. Write-only: changes on the server are detected through fingerprint. Null after import until the next apply records it.
  • repository (String) Name of a hosted apt or yum repository. Changing it forces a new resource.
  • passphrase (String, Sensitive) Passphrase of a protected private key. The server stores the key decrypted (sealed with its secrets key), so changing only the passphrase makes no API call.
  • algorithm (String) Key algorithm, e.g. rsa4096 or ed25519.
  • created_at (String) When the active key was imported or generated (RFC 3339).
  • fingerprint (String) Fingerprint (upper-case hex) of the repository’s active key.
  • id (String) Same as repository.
  • public_key (String) ASCII-armored public key to install on clients.
  • url (String) URL from which clients download the public key.

The terraform import command can be used, for example:

Terminal window
# Signing keys are imported by repository name. The private key cannot be
# read back: the next apply records the configured key (no API call when it
# matches the active key's fingerprint).
terraform import entrepot_repository_signing_key.apt apt-internal

Resource documentation generated from the provider’s schema (docs/resources/repository_signing_key.md in terraform-provider-entrepot).