This repository has been archived on 2026-11-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

4.5 KiB

page_title, subcategory, description
page_title subcategory description
artifactapi_remote_terraform Resource - artifactapi Manages an ArtifactAPI terraform remote, a caching proxy for an upstream repository. Provider download URLs are rewritten to the generic remote named in releases_remote.

artifactapi_remote_terraform (Resource)

Manages an ArtifactAPI terraform remote, a caching proxy for an upstream repository. Provider download URLs are rewritten to the generic remote named in releases_remote.

Example Usage

# A generic remote is needed for the releases CDN that the Terraform registry
# redirects provider downloads to.
resource "artifactapi_remote_generic" "hashicorp_releases" {
  name        = "hashicorp-releases"
  base_url    = "https://releases.hashicorp.com"
  description = "HashiCorp product releases"

  immutable_ttl = 0
  mutable_ttl   = 7200

  patterns = [
    "terraform/.*terraform_.*_linux_amd64\\.zip$",
    "vault/.*vault_.*_linux_amd64\\.zip$",
  ]
}

# Terraform registry remote proxies the Terraform provider registry.
# The releases_remote attribute points to a generic remote that serves
# the actual provider/module archives after URL rewriting.
resource "artifactapi_remote_terraform" "terraform_registry" {
  name            = "terraform-registry"
  base_url        = "https://registry.terraform.io"
  description     = "Terraform provider registry"
  releases_remote = artifactapi_remote_generic.hashicorp_releases.name

  immutable_ttl = 0
  mutable_ttl   = 300
}

Schema

Required

  • base_url (String) Upstream repository base URL.
  • name (String) Unique name of the remote.

Optional

  • ban_tags (List of String) Tags to ban (docker only).
  • ban_tags_enabled (Boolean) Enable tag banning (docker only).
  • blocklist (List of String) Paths to always deny (checked before patterns).
  • cache_repodata (Boolean) Cache generated repodata (github_rpm only).
  • check_mutable (Boolean) Enable conditional revalidation for mutable artifacts.
  • description (String) Human-readable description.
  • immutable_patterns (List of String) Override: paths that should be immutable even if the provider would classify as mutable.
  • immutable_ttl (Number) TTL in seconds for immutable artifacts (0 = forever).
  • mirror_strategy (String) Mirror load-balancing strategy across base_url + mirrorlist; only valid on remote rpm/deb/apk (alpine) repos. One of "round_robin" (default) or "least_conn".
  • mirrorlist (List of String) Extra upstream mirror base URLs; only valid on remote rpm/deb/apk (alpine) repos. Requests are load-balanced with failover across base_url + mirrorlist.
  • mutable_patterns (List of String) Override: paths that should be mutable even if the provider would classify as immutable.
  • mutable_ttl (Number) TTL in seconds for mutable artifacts.
  • password (String, Sensitive) Password or token for upstream authentication.
  • patterns (List of String) Paths to proxy (empty = all). This is the allowlist.
  • quarantine_days (Number) Days to quarantine new artifacts when quarantine_enabled is set.
  • quarantine_enabled (Boolean) Hold newly published upstream artifacts back until they are quarantine_days old.
  • releases_remote (String) Name of a backend remote that serves the actual download bytes. Used by the terraform remote (download URL rewriting) and the github_rpm/github_deb/github_alpine remotes (302 redirect of .rpm/.deb/.apk downloads to a generic github.com remote).
  • serve_stale (Boolean) Let rpm/deb/alpine virtuals serve this member's last good index while it refreshes.
  • stale_on_error (Boolean) Serve stale cached content when upstream is unreachable.
  • sync_interval (Number) Release re-scan interval in seconds, 0..2592000 (0 = mutable_ttl); github_rpm/github_deb/github_alpine only.
  • upstream_dial_timeout (Number) Upstream TCP connect timeout in seconds (0 = server default).
  • upstream_response_header_timeout (Number) Upstream response-header timeout in seconds (0 = server default).
  • upstream_tls_timeout (Number) Upstream TLS handshake timeout in seconds (0 = server default).
  • username (String, Sensitive) Username for upstream authentication.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Import by name.
terraform import artifactapi_remote_terraform.terraform_registry terraform-registry