diff --git a/config/config.hcl b/config/config.hcl index 7e48613..8e4b0c8 100644 --- a/config/config.hcl +++ b/config/config.hcl @@ -42,6 +42,11 @@ locals { trimsuffix(basename(file_path), ".yaml") => content if startswith(file_path, "remote_helm/") } + remote_npm = { + for file_path, content in local.all_configs : + trimsuffix(basename(file_path), ".yaml") => content + if startswith(file_path, "remote_npm/") + } remote_pypi = { 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 832ab6c..d0c4f83 100644 --- a/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl +++ b/environments/artifactapi.k8s.syd1.au.unkin.net/terragrunt.hcl @@ -24,6 +24,7 @@ inputs = { remote_github_rpm = local.config.remote_github_rpm remote_goproxy = local.config.remote_goproxy remote_helm = local.config.remote_helm + remote_npm = local.config.remote_npm remote_pypi = local.config.remote_pypi remote_rpm = local.config.remote_rpm local_terraform = local.config.local_terraform diff --git a/modules/artifactapi/main.tf b/modules/artifactapi/main.tf index 1bbd669..5b4cc8d 100644 --- a/modules/artifactapi/main.tf +++ b/modules/artifactapi/main.tf @@ -108,6 +108,19 @@ resource "artifactapi_remote_github_deb" "this" { depends_on = [artifactapi_remote_generic.this] } +resource "artifactapi_remote_npm" "this" { + for_each = var.remote_npm + + 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_pypi" "this" { for_each = var.remote_pypi diff --git a/modules/artifactapi/variables.tf b/modules/artifactapi/variables.tf index 3ca82c7..8408986 100644 --- a/modules/artifactapi/variables.tf +++ b/modules/artifactapi/variables.tf @@ -112,6 +112,20 @@ variable "remote_github_deb" { default = {} } +variable "remote_npm" { + description = "Map of npm remote repositories" + type = map(object({ + base_url = string + description = optional(string, "") + immutable_ttl = optional(number, 0) + mutable_ttl = optional(number, 3600) + patterns = optional(list(string), []) + mutable_patterns = optional(list(string), []) + stale_on_error = optional(bool, true) + })) + default = {} +} + variable "remote_pypi" { description = "Map of PyPI remote repositories" type = map(object({