Files
terraform-provider-artifactapi/examples/resources/artifactapi_remote_rpm/main.tf
T
unkin-agent 9ed7f07463
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed
resource_remote: add mirrorlist attribute (rpm/deb/apk remotes)
Expose the artifactapi remotes API's new mirrorlist field so users can
configure extra upstream mirror base URLs. The API load-balances
base_url + mirrorlist with failover.

- Add optional mirrorlist list attribute to the remote resource schema
  and the remote data source (read-only).
- Wire it end-to-end: TF model, wire model (json mirrorlist,omitempty),
  modelToAPI/apiToModel, and preserve null/empty list semantics to avoid
  plan churn.
- Scope to rpm/deb/alpine via ValidateConfig (plan-time error on other
  remote types); API 400 is the backstop.
- Docs + rpm example; unit tests for round-trip, null handling, and the
  type-scoping validation.
2026-08-13 16:16:49 +10:00

31 lines
809 B
Terraform

terraform {
required_providers {
artifactapi = {
source = "git.unkin.net/unkin/artifactapi"
version = "0.0.1"
}
}
}
provider "artifactapi" {
endpoint = "https://artifactapi.example.com"
}
# RPM remote proxies an RPM package repository.
# The provider knows repodata/* is mutable; RPM packages are immutable.
resource "artifactapi_remote_rpm" "almalinux" {
name = "almalinux"
base_url = "https://gsl-syd.mm.fcix.net/almalinux"
description = "AlmaLinux RPM package repository"
# Extra mirrors; requests are load-balanced with failover across
# base_url + mirrorlist (rpm/deb/alpine remotes only).
mirrorlist = [
"https://mirror.aarnet.edu.au/pub/almalinux",
"https://mirror.realcompute.io/almalinux",
]
immutable_ttl = 0
mutable_ttl = 7200
}