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:
parent
fe51a0aca7
commit
319461f3c6
2 changed files with 11 additions and 4 deletions
7
litestream/README.md
Normal file
7
litestream/README.md
Normal 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.
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue