The pantechdynamics_container_registry_namespace, pantechdynamics_container_repository and pantechdynamics_container_registry_token resources and their data sources, with examples.
Manage your Container Registry namespace, its repositories and registry tokens with the Terraform provider. Images themselves are pushed with docker or your CI, not Terraform.
Resource
What it is
pantechdynamics_container_registry_namespace
Your organization's namespace, and whether a first push creates a repository
pantechdynamics_container_repository
One repository: visibility, immutable tags and retention rules
pantechdynamics_container_registry_token
A registry token for CI or a cluster. Its secret is a sensitive attribute
Data source
What it reads
pantechdynamics_container_repository
A repository you already have, by id or name
pantechdynamics_container_repositories
Every repository in the namespace, including those a push created
resource "pantechdynamics_container_registry_namespace" "main" { name = "acme" create_on_push = false}
Argument
name
Required. Globally unique: 3 to 30 lower-case letters, digits and single hyphens, starting with a letter; reserved words such as library, pantech and admin are refused. Changing it renames the namespace in place, and is refused once a repository has ever been created in it
create_on_push
Optional. Whether the first push to a new name creates the repository. Default true
Attribute
registry_host
registry.pantechdynamics.com
repository_count
Repositories in the namespace
storage_bytes
Storage used
storage_limit_bytes
The namespace's storage limit; pushes past it are refused
repository_limit
The most repositories it may hold
An organization has one namespace, so there is at most one of this resource. Destroying it only removes it from Terraform's state: the namespace stays, and so do its repositories.
resource "pantechdynamics_container_repository" "api" { name = "api/server" description = "The API server" visibility = "private" immutable_tags = true retention = { keep_last = 50 untagged_after_days = 7 keep_pattern = "v*" } depends_on = [pantechdynamics_container_registry_namespace.main]}output "image" { value = pantechdynamics_container_repository.api.full_name}
Argument
name
Required. Such as api/server: lower-case path parts of letters and digits, with single ., _ or - between them, up to 255 characters. Changing it replaces the repository, which deletes its images
description
Optional. Up to 255 characters
visibility
Optional. private (the default) or public, which anyone can pull without logging in
immutable_tags
Optional. A tag, once pushed, cannot be moved or deleted. Default false
retention
Optional. Cleanup, run daily: keep_last (1 to 1,000), untagged_after_days (1 to 365) and keep_pattern (a glob such as v*, whose tags are always kept); set at least one. Leave it out for no cleanup
Attribute
id
crr_…
full_name
The image name to tag, push and pull
tag_count
Tags in the repository
storage_bytes
Storage its images use
status
active, deleting or suspended
Destroying a repository deletes every image in it, and cannot be undone. It needs a key with the delete scope.
data "pantechdynamics_container_repository" "api" { name = "api/server"}data "pantechdynamics_container_repositories" "all" {}output "repository_names" { value = [for r in data.pantechdynamics_container_repositories.all.repositories : r.full_name]}