1
0
Fork 0
mirror of https://github.com/imjasonh/terraform-playground synced 2026-07-07 23:35:16 +00:00

update readme

Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
Jason Hall 2024-04-17 13:13:41 -04:00
parent fe51a0aca7
commit 319461f3c6
Failed to extract signature
2 changed files with 11 additions and 4 deletions

7
litestream/README.md Normal file
View file

@ -0,0 +1,7 @@
# Litestream on Cloud Storage + Cloud Run
This demonstrates running a Cloud Run service that uses [Litestream](https://litestream.io) to backup a SQLite database to a Cloud Storage bucket.
It does this by running the Litestream image as a sidecar container in the same pod as the application container, with a shared volume mounted between them.
The bucket configuration is written to a config file appended to the litestream image.

View file

@ -77,12 +77,12 @@ resource "google_cloud_run_v2_service" "service" {
}
}
data "oci_ref" "litestream" { ref = "litestream/litestream" }
// Copy the litestream image to GCR, if it's changed.
// TODO: This should be an oci_copy resource.
resource "null_resource" "crane-cp" {
triggers = {
bucket = google_storage_bucket.bucket.name
image = ko_build.build.image_ref
}
triggers = { digest = data.oci_ref.litestream.digest }
provisioner "local-exec" {
command = "crane cp --platform=linux/amd64 litestream/litestream gcr.io/${local.project_id}/litestream:latest"