Skip to content

frostmoln_ca_bundle (Data Source) ​

The Frostmoln customer CA bundle: the root certificate(s) that sign every managed instance's TLS certificate (databases, caches, message brokers, webservers). Trust the whole pem in a client to connect with full certificate and hostname verification. During a root rollover the bundle holds both the current and the next root. Only self-signed CA certificates are accepted. Pin the bundle with expected_fingerprints (from the published documentation) to verify it.

Example Usage ​

terraform
data "frostmoln_ca_bundle" "this" {
  # Pin the bundle to the SHA-256 fingerprints published in the Frostmoln
  # documentation; the read fails unless the bundle holds exactly these.
  #
  # Root rollover: the next root is first ADDED to the bundle, and its
  # fingerprint is published on the documentation page in advance. Until this
  # set is updated to the newly published one (old and next root), the read
  # fails. When the old root is later removed, update the set again.
  expected_fingerprints = var.frostmoln_ca_fingerprints
}

variable "frostmoln_ca_fingerprints" {
  description = "SHA-256 fingerprints of the Frostmoln customer CA, from the documentation."
  type        = set(string)
}

# The PEM to install as a trust anchor, e.g. written to a file and used as
# psql "sslmode=verify-full sslrootcert=frostmoln-ca.pem ...".
output "ca_bundle_pem" {
  value = data.frostmoln_ca_bundle.this.pem
}

output "ca_fingerprints" {
  value = data.frostmoln_ca_bundle.this.fingerprints
}

output "ca_certificates" {
  value = [for c in data.frostmoln_ca_bundle.this.certificates : "${c.subject} (until ${c.not_after})"]
}

Schema ​

Optional ​

  • expected_fingerprints (Set of String) SHA-256 fingerprints the bundle must hold, taken from the Frostmoln documentation rather than from this API. When set, the bundle must hold exactly these certificates, or the read fails. Hex, any case, colons allowed. This is the integrity control: the provider's own check that the PEM matches the API's certificate list only catches an inconsistent server, since both come from the same response. Root rollover: a rollover first ADDS the next root to the bundle, and its fingerprint is published on the documentation page in advance, so a pinned configuration fails until this set is updated to the newly published one (old and next root); when the old root is later removed, the published set changes again and the pin must be updated again. Update the pin whenever the published set changes.

Read-Only ​

  • certificates (Attributes List) The certificates in the bundle. (see below for nested schema)
  • fingerprints (List of String) The SHA-256 fingerprints of the certificates, as lowercase hex, in the same order as certificates.
  • pem (String) The CA bundle as PEM text, re-encoded from the parsed certificates: one CERTIFICATE block per self-signed CA certificate.

Nested Schema for certificates ​

Read-Only:

  • fingerprint_sha256 (String) The SHA-256 fingerprint of the certificate (DER), as lowercase hex.
  • not_after (String) End of the certificate's validity (RFC 3339).
  • not_before (String) Start of the certificate's validity (RFC 3339).
  • subject (String) The certificate subject, read from the certificate.