Skip to main content

tharsis_gpg_key

Defines and manages a GPG key.

Example Usage​

resource "tharsis_gpg_key" "this" {
group_id = tharsis_group.top_level.id
ascii_armor = file("${path.module}/public-key.asc")
}

Behavior​

  • GPG keys are group-level and are used to verify the signatures of Terraform provider versions uploaded to the Tharsis provider registry.
  • ascii_armor is the ASCII-armored public key.
  • Changing to a different key, or moving it to a different group, replaces the GPG key. Re-uploading the same key with different armor, or switching group_id between an ID and a TRN of the same group, is an in-place update.
  • Uploading provider versions requires that a key has already been added to the group by an owner or deployer.

Schema​

Required​

  • ascii_armor (String) The ASCII armored key: one PGP public key block holding exactly one public key and no private key material. Checked at plan time.

Optional​

  • group_id (String) The ID or TRN of the parent group.
  • group_path (String, Deprecated) Path of the parent group.

Read-Only​

  • created_by (String) The email address of the user or account that created this GPG key.
  • fingerprint (String) The fingerprint of the GPG key.
  • gpg_key_id (String) The GPG key string for this GPG key.
  • id (String) String identifier of the GPG key.
  • last_updated (String) Timestamp when this GPG key was most recently updated by Terraform.
  • resource_path (String, Deprecated) Path of this GPG key.

Import​

Import is supported using the following syntax:

In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

# A GPG key can be imported by its TRN, which is "trn:gpg_key:" followed by the
# group path and the key's fingerprint.
import {
to = tharsis_gpg_key.this
id = "trn:gpg_key:my-group/C48F7F19B14E59433DF9402341F57AB6741F92F1"
}

# The key's ID also works as the id, shown by the "id" attribute or in the
# Tharsis UI.