frostmoln_container_registry_repositories (Data Source)
Lists the repositories in this tenant's container registry namespace.
OBSERVATIONAL, like storage_used_bytes on frostmoln_container_registry: a repository appears on its first docker push and disappears when the last artifact in it is deleted, and its counters move on every push and pull. Expect the values to differ on every refresh, and do not build a configuration that plans a change from them.
A tenant that has NOT enabled its registry is an error here, not an empty list. An empty list would make "this tenant has no registry" and "this registry holds no images" indistinguishable, and a configuration reading the second would quietly do nothing when the first was true.
Example Usage
terraform
# Every repository in this tenant's container registry namespace.
#
# The registry must already be enabled: a tenant that has not opted in gets an
# error here, not an empty list, so that "this tenant has no registry" and "this
# registry holds no images" stay distinguishable.
data "frostmoln_container_registry_repositories" "all" {}
# The endpoint and namespace a pull reference is built from.
data "frostmoln_container_registry" "current" {}
# Repository names are RELATIVE to the namespace and may themselves contain "/",
# so join them onto the namespace rather than assuming a single path segment.
output "repository_pull_references" {
value = [
for r in data.frostmoln_container_registry_repositories.all.repositories :
format(
"%s/%s/%s",
data.frostmoln_container_registry.current.endpoint,
data.frostmoln_container_registry.current.namespace,
r.name,
)
]
}
# Repositories nothing has ever pulled - a candidate list for a cleanup review.
#
# These counters are OBSERVATIONAL: they move on every push and pull, with no
# Terraform change involved, so read them and report on them; never write a
# configuration that plans a change from them.
output "never_pulled_repositories" {
value = [
for r in data.frostmoln_container_registry_repositories.all.repositories :
r.name if r.pull_count == 0
]
}Schema
Read-Only
repositories(Attributes List) Every repository in the namespace. Empty when the registry is enabled and nothing has been pushed to it yet. (see below for nested schema)
Nested Schema for repositories
Read-Only:
artifact_count(Number) How many artifacts (image manifests) the repository holds, including untagged ones. OBSERVATIONAL: every push changes it.created_at(String) When the repository first appeared — the timestamp of its first push, RFC 3339.name(String) The repository name RELATIVE to the tenant's namespace, so a full image reference is<endpoint>/<namespace>/<name>. It may itself contain/— treat it as a path, never as a single segment.pull_count(Number) How many times the repository has been pulled, as the registry counts it. OBSERVATIONAL: it moves whenever anything pulls, with no Terraform change involved.updated_at(String) When the repository last changed, RFC 3339. OBSERVATIONAL: a push moves it.