setup cron local mail reporting and longhorn recurring backup job
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# https://longhorn.io/docs/1.9.1/snapshots-and-backups/backup-and-restore/set-backup-target/#set-up-gcp-cloud-storage-backupstore
|
||||
resource "google_storage_bucket" "longhorn_backup" {
|
||||
name = "arcodange-backup"
|
||||
location = "US-EAST1"
|
||||
location = "NAM4" # https://cloud.google.com/storage/docs/locations#location-dr
|
||||
force_destroy = true
|
||||
|
||||
public_access_prevention = "enforced"
|
||||
@@ -17,8 +17,8 @@ resource "google_storage_bucket_iam_member" "longhorn_backup" {
|
||||
member = "serviceAccount:${google_service_account.longhorn_backup.email}"
|
||||
}
|
||||
|
||||
resource "google_service_account_key" "longhorn_backup" {
|
||||
service_account_id = google_service_account.longhorn_backup.account_id
|
||||
resource "google_storage_hmac_key" "longhorn_backup" {
|
||||
service_account_email = google_service_account.longhorn_backup.email
|
||||
|
||||
}
|
||||
|
||||
@@ -34,9 +34,11 @@ resource "vault_kv_secret_v2" "longhorn_gcs_backup" {
|
||||
name = "longhorn/gcs-backup"
|
||||
cas = 1
|
||||
delete_all_versions = true
|
||||
data_json = base64decode(
|
||||
google_service_account_key.longhorn_backup.private_key
|
||||
)
|
||||
data_json = jsonencode({
|
||||
AWS_ACCESS_KEY_ID = google_storage_hmac_key.longhorn_backup.access_id
|
||||
AWS_SECRET_ACCESS_KEY = google_storage_hmac_key.longhorn_backup.secret
|
||||
AWS_ENDPOINTS: "https://storage.googleapis.com"
|
||||
})
|
||||
}
|
||||
|
||||
data "vault_policy_document" "longhorn_gcs_backup" {
|
||||
|
||||
Reference in New Issue
Block a user