entrepot_routing_rule
A routing rule limits which requests a proxy repository forwards upstream (set it with proxy.routing_rule on an entrepot_repository). Use it to stop internal package names from ever being fetched from a public registry (dependency confusion), or to allow only an approved set.
A rule cannot be deleted while proxy repositories use it; when repositories reference the rule resource, Terraform updates them first.
Example Usage
Section titled “Example Usage”# Never fetch internal package names from the public registry# (dependency-confusion protection).resource "entrepot_routing_rule" "no_internal_upstream" { name = "no-internal-upstream" description = "Internal scopes are only served from hosted repositories" mode = "block" matchers = ["^@acme/", "^acme-"]}
resource "entrepot_repository" "npmjs" { name = "npmjs" format = "npm" kind = "proxy" blob_store = "default" proxy = { remote_url = "https://registry.npmjs.org" routing_rule = entrepot_routing_rule.no_internal_upstream.name }}Schema
Section titled “Schema”Required
Section titled “Required”matchers(List of String) Go regular expressions over the package / image name or request path, e.g.^@acme/or^acme-. The first matching expression decides.mode(String)allow: only requests matching a matcher go upstream;block: matching requests never go upstream.name(String) Rule name. Changing it forces a new rule.
Optional
Section titled “Optional”description(String) Free-form description.
Read-Only
Section titled “Read-Only”id(String) Same asname.repositories(List of String) Proxy repositories that currently use the rule (informational). It changes when repositories are configured and is refreshed on every read; it never causes a diff.
Import
Section titled “Import”The terraform import command can be used, for example:
# Routing rules are imported by name.terraform import entrepot_routing_rule.no_internal_upstream no-internal-upstreamResource documentation generated from the provider’s schema (docs/resources/routing_rule.md in terraform-provider-entrepot).