Skip to content

Commit

Permalink
Add configurable Iglu cache size and TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
pondzix committed Apr 19, 2024
1 parent 9eb14bd commit 9136fce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ locals {
local.resolvers_closed
])

iglu_resolver = templatefile("${path.module}/templates/iglu_resolver.json.tmpl", { resolvers = jsonencode(local.resolvers) })
iglu_resolver = templatefile("${path.module}/templates/iglu_resolver.json.tmpl", {
resolvers = jsonencode(local.resolvers)
cache_size = var.iglu_cache_size
cache_ttl = var.iglu_cache_ttl_seconds
})

hocon = templatefile("${path.module}/templates/config.json.tmpl", {
project_id = var.project_id
Expand Down
4 changes: 2 additions & 2 deletions templates/iglu_resolver.json.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schema": "iglu:com.snowplowanalytics.iglu/resolver-config/jsonschema/1-0-2",
"data": {
"cacheSize": 500,
"cacheTtl": 600,
"cacheSize": ${cache_size},
"cacheTtl": ${cache_ttl},
"repositories": ${resolvers}
}
}
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ variable "custom_iglu_resolvers" {
}))
}

variable "iglu_cache_size" {
type = number
default = 500
}

variable "iglu_cache_ttl_seconds" {
type = number
default = 600
}

# --- Telemetry

variable "telemetry_enabled" {
Expand Down

0 comments on commit 9136fce

Please sign in to comment.