b8ee0ed385
Expose the provider v0.5.1 mirror_strategy field through the config module so rpm and alpine(apk) remotes can select how upstream mirrors are chosen (round_robin | least_conn) across base_url + mirrorlist. Completes the mirror IaC surface started in #24. - remote_rpm / remote_alpine object vars gain mirror_strategy = optional(string, null) - pass mirror_strategy through to the corresponding remote resources - provider constraint stays ~> 0.5 (already resolves v0.5.1, which adds the attr) Additive and optional; no real remote config changes.
139 lines
4.0 KiB
Terraform
139 lines
4.0 KiB
Terraform
resource "artifactapi_remote_alpine" "this" {
|
|
for_each = var.remote_alpine
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
immutable_patterns = each.value.immutable_patterns
|
|
mutable_patterns = each.value.mutable_patterns
|
|
stale_on_error = each.value.stale_on_error
|
|
mirrorlist = each.value.mirrorlist
|
|
mirror_strategy = each.value.mirror_strategy
|
|
}
|
|
|
|
resource "artifactapi_remote_docker" "this" {
|
|
for_each = var.remote_docker
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
patterns = each.value.patterns
|
|
mutable_patterns = each.value.mutable_patterns
|
|
stale_on_error = each.value.stale_on_error
|
|
ban_tags_enabled = each.value.ban_tags_enabled
|
|
ban_tags = each.value.ban_tags
|
|
}
|
|
|
|
resource "artifactapi_remote_generic" "this" {
|
|
for_each = var.remote_generic
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
patterns = each.value.patterns
|
|
mutable_patterns = each.value.mutable_patterns
|
|
stale_on_error = each.value.stale_on_error
|
|
}
|
|
|
|
resource "artifactapi_remote_goproxy" "this" {
|
|
for_each = var.remote_goproxy
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
stale_on_error = each.value.stale_on_error
|
|
}
|
|
|
|
resource "artifactapi_remote_helm" "this" {
|
|
for_each = var.remote_helm
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
check_mutable = each.value.check_mutable
|
|
immutable_patterns = each.value.immutable_patterns
|
|
stale_on_error = each.value.stale_on_error
|
|
}
|
|
|
|
resource "artifactapi_remote_rpm" "this" {
|
|
for_each = var.remote_rpm
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
immutable_patterns = each.value.immutable_patterns
|
|
mutable_patterns = each.value.mutable_patterns
|
|
stale_on_error = each.value.stale_on_error
|
|
mirrorlist = each.value.mirrorlist
|
|
mirror_strategy = each.value.mirror_strategy
|
|
}
|
|
|
|
resource "artifactapi_remote_pypi" "this" {
|
|
for_each = var.remote_pypi
|
|
|
|
name = each.key
|
|
base_url = each.value.base_url
|
|
description = each.value.description
|
|
immutable_ttl = each.value.immutable_ttl
|
|
mutable_ttl = each.value.mutable_ttl
|
|
patterns = each.value.patterns
|
|
mutable_patterns = each.value.mutable_patterns
|
|
stale_on_error = each.value.stale_on_error
|
|
}
|
|
|
|
resource "artifactapi_local_terraform" "this" {
|
|
for_each = var.local_terraform
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
}
|
|
|
|
resource "artifactapi_local_pypi" "this" {
|
|
for_each = var.local_pypi
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
}
|
|
|
|
resource "artifactapi_local_rpm" "this" {
|
|
for_each = var.local_rpm
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
}
|
|
|
|
resource "artifactapi_local_docker" "this" {
|
|
for_each = var.local_docker
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
}
|
|
|
|
resource "artifactapi_local_generic" "this" {
|
|
for_each = var.local_generic
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
}
|
|
|
|
resource "artifactapi_virtual" "this" {
|
|
for_each = var.virtual
|
|
|
|
name = each.key
|
|
package_type = each.value.package_type
|
|
description = each.value.description
|
|
members = each.value.members
|
|
}
|