1 Commits

Author SHA1 Message Date
unkinben 502053abef feat: manage local docker registries
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/plan Pipeline failed
ArtifactAPI now serves local docker repos as real container registries and the
provider exposes an artifactapi_local_docker resource, but this config had no
way to declare one.

- Add a local_docker variable, module resource, config loader wiring, and
  terragrunt input, mirroring the other local_* kinds.
- Declare a docker-internal registry.
- Expand the README to cover the local_* and virtual kinds.

Depends on a terraform-provider-artifactapi release exposing
artifactapi_local_docker (and a matching .terraform.lock.hcl bump) before apply.
2026-07-04 22:41:12 +10:00
6 changed files with 31 additions and 1 deletions
+9 -1
View File
@@ -1,3 +1,11 @@
# terraform-artifactapi # terraform-artifactapi
Terraform configuration for managing ArtifactAPI remote and virtual repositories Terraform configuration for managing ArtifactAPI remote, local, and virtual repositories.
Repositories are declared as YAML files under `config/<kind>/<name>.yaml`, where the
filename is the repository name. `make plan` / `make apply` (via Terragrunt) reconcile
them against the ArtifactAPI instance.
Kinds: `remote_*` (caching proxies of an upstream), `local_*` (real registries hosted
directly — `local_docker`, `local_pypi`, `local_rpm`, `local_terraform`), and `virtual`
(merged views over members of one package type).
+5
View File
@@ -57,6 +57,11 @@ locals {
trimsuffix(basename(file_path), ".yaml") => content trimsuffix(basename(file_path), ".yaml") => content
if startswith(file_path, "local_rpm/") if startswith(file_path, "local_rpm/")
} }
local_docker = {
for file_path, content in local.all_configs :
trimsuffix(basename(file_path), ".yaml") => content
if startswith(file_path, "local_docker/")
}
virtual = { virtual = {
for file_path, content in local.all_configs : for file_path, content in local.all_configs :
trimsuffix(basename(file_path), ".yaml") => content trimsuffix(basename(file_path), ".yaml") => content
+1
View File
@@ -0,0 +1 @@
description: "Internal container image registry"
@@ -27,5 +27,6 @@ inputs = {
local_terraform = local.config.local_terraform local_terraform = local.config.local_terraform
local_pypi = local.config.local_pypi local_pypi = local.config.local_pypi
local_rpm = local.config.local_rpm local_rpm = local.config.local_rpm
local_docker = local.config.local_docker
virtual = local.config.virtual virtual = local.config.virtual
} }
+7
View File
@@ -110,6 +110,13 @@ resource "artifactapi_local_rpm" "this" {
description = each.value.description description = each.value.description
} }
resource "artifactapi_local_docker" "this" {
for_each = var.local_docker
name = each.key
description = each.value.description
}
resource "artifactapi_virtual" "this" { resource "artifactapi_virtual" "this" {
for_each = var.virtual for_each = var.virtual
+8
View File
@@ -120,6 +120,14 @@ variable "local_terraform" {
default = {} default = {}
} }
variable "local_docker" {
description = "Map of local Docker repositories (real container registries)"
type = map(object({
description = optional(string, "")
}))
default = {}
}
variable "virtual" { variable "virtual" {
description = "Map of virtual repositories" description = "Map of virtual repositories"
type = map(object({ type = map(object({