diff --git a/config/config.hcl b/config/config.hcl index 453b492..7e48613 100644 --- a/config/config.hcl +++ b/config/config.hcl @@ -22,6 +22,16 @@ locals { trimsuffix(basename(file_path), ".yaml") => content if startswith(file_path, "remote_generic/") } + remote_github_deb = { + for file_path, content in local.all_configs : + trimsuffix(basename(file_path), ".yaml") => content + if startswith(file_path, "remote_github_deb/") + } + remote_github_rpm = { + for file_path, content in local.all_configs : + trimsuffix(basename(file_path), ".yaml") => content + if startswith(file_path, "remote_github_rpm/") + } remote_goproxy = { for file_path, content in local.all_configs : trimsuffix(basename(file_path), ".yaml") => content diff --git a/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl b/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl index 3a566cb..832ab6c 100644 --- a/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl +++ b/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl @@ -17,17 +17,19 @@ terraform { } inputs = { - remote_alpine = local.config.remote_alpine - remote_docker = local.config.remote_docker - remote_generic = local.config.remote_generic - remote_goproxy = local.config.remote_goproxy - remote_helm = local.config.remote_helm - remote_pypi = local.config.remote_pypi - remote_rpm = local.config.remote_rpm - local_terraform = local.config.local_terraform - local_pypi = local.config.local_pypi - local_rpm = local.config.local_rpm - local_docker = local.config.local_docker - local_generic = local.config.local_generic - virtual = local.config.virtual + remote_alpine = local.config.remote_alpine + remote_docker = local.config.remote_docker + remote_generic = local.config.remote_generic + remote_github_deb = local.config.remote_github_deb + remote_github_rpm = local.config.remote_github_rpm + remote_goproxy = local.config.remote_goproxy + remote_helm = local.config.remote_helm + remote_pypi = local.config.remote_pypi + remote_rpm = local.config.remote_rpm + local_terraform = local.config.local_terraform + local_pypi = local.config.local_pypi + local_rpm = local.config.local_rpm + local_docker = local.config.local_docker + local_generic = local.config.local_generic + virtual = local.config.virtual } diff --git a/modules/artifactapi/main.tf b/modules/artifactapi/main.tf index dc19454..1bbd669 100644 --- a/modules/artifactapi/main.tf +++ b/modules/artifactapi/main.tf @@ -80,6 +80,34 @@ resource "artifactapi_remote_rpm" "this" { mirror_strategy = each.value.mirror_strategy } +resource "artifactapi_remote_github_rpm" "this" { + for_each = var.remote_github_rpm + + name = each.key + base_url = each.value.base_url + description = each.value.description + releases_remote = each.value.releases_remote + mutable_ttl = each.value.mutable_ttl + patterns = each.value.patterns + stale_on_error = each.value.stale_on_error + + depends_on = [artifactapi_remote_generic.this] +} + +resource "artifactapi_remote_github_deb" "this" { + for_each = var.remote_github_deb + + name = each.key + base_url = each.value.base_url + description = each.value.description + releases_remote = each.value.releases_remote + mutable_ttl = each.value.mutable_ttl + patterns = each.value.patterns + stale_on_error = each.value.stale_on_error + + depends_on = [artifactapi_remote_generic.this] +} + resource "artifactapi_remote_pypi" "this" { for_each = var.remote_pypi diff --git a/modules/artifactapi/variables.tf b/modules/artifactapi/variables.tf index 660e944..3ca82c7 100644 --- a/modules/artifactapi/variables.tf +++ b/modules/artifactapi/variables.tf @@ -86,6 +86,32 @@ variable "remote_rpm" { default = {} } +variable "remote_github_rpm" { + description = "Map of GitHub-release-backed RPM remote repositories" + type = map(object({ + base_url = string + description = optional(string, "") + releases_remote = string + mutable_ttl = optional(number, 3600) + patterns = optional(list(string), []) + stale_on_error = optional(bool, true) + })) + default = {} +} + +variable "remote_github_deb" { + description = "Map of GitHub-release-backed DEB remote repositories" + type = map(object({ + base_url = string + description = optional(string, "") + releases_remote = string + mutable_ttl = optional(number, 3600) + patterns = optional(list(string), []) + stale_on_error = optional(bool, true) + })) + default = {} +} + variable "remote_pypi" { description = "Map of PyPI remote repositories" type = map(object({