feat: add backup bucket

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
Lander Van den Bulcke 2025-01-14 08:59:51 +01:00
parent b9f3259f6a
commit 00ae60fb07
Signed by: lander
GPG key ID: 0142722B4B0C536F
3 changed files with 54 additions and 43 deletions

View file

@ -1,3 +1,38 @@
# Bucket for backups
resource "b2_bucket" "backups" {
bucket_name = "lvdb-backups"
bucket_type = "allPrivate"
}
# Application key for backups bucket
resource "b2_application_key" "restic" {
bucket_id = b2_bucket.backups.id
key_name = "restic"
capabilities = [
"deleteFiles",
"listAllBucketNames",
"listBuckets",
"listFiles",
"readBucketEncryption",
"readBucketReplications",
"readBuckets",
"readFiles",
"shareFiles",
"writeBucketEncryption",
"writeBucketReplications",
"writeFiles"
]
}
output "restic_application_key" {
value = b2_application_key.restic.application_key
sensitive = true
}
output "restic_application_key_id" {
value = b2_application_key.restic.application_key_id
}
# Bucket for storage of nix cache
resource "cloudflare_r2_bucket" "attic" {
account_id = var.account_id