Skip to content

Commit 92f648d

Browse files
authored
Merge pull request #39 from datafold/gerard-eng-2673-reduce-clickhouse-backup-retention-to-7-days
fix: Update clickhouse backup retention
2 parents 21d7e1f + 531834b commit 92f648d

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Now all containers should be up and running.
195195
| Name | Description | Type | Default | Required |
196196
|------|-------------|------|---------|:--------:|
197197
| <a name="input_add_onprem_support_group"></a> [add\_onprem\_support\_group](#input\_add\_onprem\_support\_group) | Flag to add onprem support group for [email protected] | `bool` | `true` | no |
198+
| <a name="input_backup_lifecycle_expiration_days"></a> [backup\_lifecycle\_expiration\_days](#input\_backup\_lifecycle\_expiration\_days) | Number of days after which clickhouse backup objects will expire and be deleted. | `number` | `6` | no |
198199
| <a name="input_ch_machine_type"></a> [ch\_machine\_type](#input\_ch\_machine\_type) | The machine type for the ch GKE cluster nodes | `string` | `"n2-standard-8"` | no |
199200
| <a name="input_clickhouse_backup_sa_key"></a> [clickhouse\_backup\_sa\_key](#input\_clickhouse\_backup\_sa\_key) | SA key from secrets | `string` | `""` | no |
200201
| <a name="input_clickhouse_data_disk_size"></a> [clickhouse\_data\_disk\_size](#input\_clickhouse\_data\_disk\_size) | Data volume size clickhouse | `number` | `40` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module "clickhouse_backup" {
2727
project_id = var.project_id
2828
clickhouse_get_backup_sa_from_secrets_yaml = var.clickhouse_get_backup_sa_from_secrets_yaml
2929
legacy_naming = var.legacy_naming
30+
backup_lifecycle_expiration_days = var.backup_lifecycle_expiration_days
3031
}
3132

3233
module "networking" {

modules/clickhouse_backup/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ resource "google_storage_bucket" "clickhouse_backup" {
1515

1616
lifecycle_rule {
1717
condition {
18-
age = 14
18+
age = var.backup_lifecycle_expiration_days
1919
}
2020
action {
2121
type = "Delete"

modules/clickhouse_backup/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@ variable "legacy_naming" {
4040
default = true
4141
description = "Flag to toggle legacy behavior - like naming of resources"
4242
}
43+
44+
variable "backup_lifecycle_expiration_days" {
45+
type = number
46+
default = 6
47+
description = "Number of days after which clickhouse backup objects will expire and be deleted."
48+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ variable "clickhouse_backup_sa_key" {
418418
default = ""
419419
}
420420

421+
variable "backup_lifecycle_expiration_days" {
422+
type = number
423+
default = 6
424+
description = "Number of days after which clickhouse backup objects will expire and be deleted."
425+
}
426+
421427
# ┏━╸╻╺┳╸╻ ╻╻ ╻┏┓
422428
# ┃╺┓┃ ┃ ┣━┫┃ ┃┣┻┓
423429
# ┗━┛╹ ╹ ╹ ╹┗━┛┗━┛

0 commit comments

Comments
 (0)