Skip to content

entrepot_repository

A repository: hosted (you publish to it), proxy (pull-through cache of an upstream) or group (an ordered union of repositories of the same format).

# Pull-through cache of the public npm registry.
resource "entrepot_repository" "npmjs" {
name = "npmjs"
format = "npm"
kind = "proxy"
blob_store = "default"
anonymous_read = true
proxy = {
remote_url = "https://registry.npmjs.org"
routing_rule = "internal-names" # never fetch @acme/* from the public registry
}
scan = {
scanners = ["trivy"]
mode = "quarantine"
severity_threshold = "high"
}
}
# Internal packages, published by CI.
resource "entrepot_repository" "npm_internal" {
name = "npm-internal"
format = "npm"
kind = "hosted"
blob_store = "default"
cleanup_policies = ["prune-prereleases"]
lifecycle {
prevent_destroy = true # replacing a repository deletes its content
}
}
# One URL for clients: internal packages first, then npmjs.
resource "entrepot_repository" "npm" {
name = "npm"
format = "npm"
kind = "group"
blob_store = "default"
group = {
members = [entrepot_repository.npm_internal.name, entrepot_repository.npmjs.name]
prefer_hosted = true # dependency-confusion protection
}
}
# A signed Apt repository with two distributions.
resource "entrepot_repository" "apt" {
name = "apt-internal"
format = "apt"
kind = "hosted"
blob_store = "default"
hosted = {
apt = {
distributions = [
{ name = "bookworm", components = ["main"], architectures = ["amd64", "arm64", "all"] },
{ name = "noble", components = ["main"], architectures = ["amd64", "all"] },
]
}
}
}
  • blob_store (String) Blob store for the repository’s content. Changing it forces a new repository (content is not migrated).
  • format (String) One of raw, pypi, npm, docker, apt, yum, helm. Changing it forces a new repository.
  • kind (String) hosted, proxy or group. Changing it forces a new repository.
  • name (String) Repository name (part of client URLs). Changing it forces a new repository.
  • anonymous_read (Boolean) Allow unauthenticated reads.
  • cleanup_policies (List of String) Names of entrepot_cleanup_policys applied to the repository.
  • description (String)
  • group (Attributes) Required for kind = "group". (see below for nested schema)
  • hosted (Attributes) Settings for kind = "hosted". (see below for nested schema)
  • online (Boolean) Offline proxies serve only cached content.
  • proxy (Attributes) Required for kind = "proxy". (see below for nested schema)
  • scan (Attributes) Vulnerability scanning policy. (see below for nested schema)
  • id (String) Same as name.
  • url (String) URL to configure package clients with.

Required:

  • members (List of String) Member repositories, searched in order.

Optional:

  • prefer_hosted (Boolean) npm/PyPI/Helm: never serve a package name from proxy members when a hosted member has it (dependency-confusion protection). Server default: true.

Optional:

  • allow_redeploy (Boolean) Allow overwriting existing versions (for Docker: moving tags). Server default: false, true for Docker.
  • apt (Attributes) Apt distributions to publish. (see below for nested schema)
  • yum (Attributes) Yum repodata settings. (see below for nested schema)

Optional:

Nested Schema for hosted.apt.distributions

Section titled “Nested Schema for hosted.apt.distributions”

Required:

  • name (String) e.g. stable, bookworm.

Optional:

  • architectures (List of String) Architectures, e.g. amd64, arm64, all.
  • components (List of String) Components (default main).
  • label (String)
  • origin (String)

Optional:

  • repodata_depth (Number) Directory depth at which repodata is generated (0 = root).

Required:

  • remote_url (String) Upstream URL, e.g. https://registry.npmjs.org.

Optional:

  • content_ttl_seconds (Number) Cache time for artifacts (default: never expire).
  • metadata_ttl_seconds (Number) Cache time for indexes/metadata (server default 3600).
  • negative_cache_ttl_seconds (Number) Cache time for upstream 404s (server default 300, -1 disables).
  • password (String, Sensitive) Write-only: never returned by the API, so changes made outside Terraform are not detected.
  • routing_rule (String) Name of an entrepot_routing_rule restricting what is fetched upstream.
  • username (String)

Optional:

  • block_until_scanned (Boolean)
  • distro (String) Apt/Yum: distribution for vulnerability matching, e.g. debian-12, rocky-9.
  • mode (String) off, warn (record findings) or quarantine (block downloads). Server default: warn.
  • on_proxy_fetch (Boolean)
  • on_upload (Boolean)
  • scanners (List of String) Names of entrepot_scanners to run.
  • severity_threshold (String) Lowest severity that quarantines. Server default: high.

The terraform import command can be used, for example:

Terminal window
# Repositories are imported by name.
terraform import entrepot_repository.npm_internal npm-internal

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