Skip to content

Commit

Permalink
feat: add kv cache for pmtiles directories
Browse files Browse the repository at this point in the history
  • Loading branch information
zackpollard committed Jul 29, 2024
1 parent 9466220 commit 2b2347a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 76 deletions.
127 changes: 51 additions & 76 deletions deployment/modules/cloudflare/tiles/dist/tiles.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions deployment/modules/cloudflare/tiles/kv.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "cloudflare_workers_kv_namespace" "tiles" {
account_id = var.cloudflare_account_id
title = "tiles"
}

import {
to = cloudflare_workers_kv_namespace.tiles
id = "${var.cloudflare_account_id}/5a4b82694e8b490db8b8904cdaea4f00"
}
5 changes: 5 additions & 0 deletions deployment/modules/cloudflare/tiles/workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ resource "cloudflare_worker_script" "tiles" {
name = "BUCKET"
bucket_name = cloudflare_r2_bucket.tiles.name
}

kv_namespace_binding {
name = "KV"
namespace_id = cloudflare_workers_kv_namespace.tiles.id
}
}

resource "cloudflare_worker_domain" "tiles" {
Expand Down

0 comments on commit 2b2347a

Please sign in to comment.