Skip to content

Commit

Permalink
feat:make compression default for backups for mysql and postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
gleichda committed Oct 24, 2022
1 parent 7818a7e commit ff37244
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/mysql-backup-create-service-account/main.tf
Expand Up @@ -51,5 +51,5 @@ module "backup" {
backup_retention_time = 1
backup_schedule = "5 * * * *"
export_schedule = "10 * * * *"
compress_export = true
compress_export = false
}
2 changes: 1 addition & 1 deletion modules/backup/README.md
Expand Up @@ -55,7 +55,7 @@ fetch workflows.googleapis.com/Workflow
|------|-------------|------|---------|:--------:|
| backup\_retention\_time | The number of days backups should be kept | `number` | `30` | no |
| backup\_schedule | The cron schedule to execute the internal backup | `string` | `"45 2 * * *"` | no |
| compress\_export | Whether or not to compress the export when storing in the bucket; Only valid for MySQL and PostgreSQL | `bool` | `false` | no |
| compress\_export | Whether or not to compress the export when storing in the bucket; Only valid for MySQL and PostgreSQL | `bool` | `true` | no |
| enable\_export\_backup | Weather to create exports to GCS Buckets with this module | `bool` | `true` | no |
| enable\_internal\_backup | Wether to create internal backups with this module | `bool` | `true` | no |
| export\_databases | The list of databases that should be exported - if is an empty set all databases will be exported | `set(string)` | `[]` | no |
Expand Down
3 changes: 1 addition & 2 deletions modules/backup/variables.tf
Expand Up @@ -88,9 +88,8 @@ variable "export_uri" {
}
}

#TODO: gleichda change default to true on next major release (#336)
variable "compress_export" {
description = "Whether or not to compress the export when storing in the bucket; Only valid for MySQL and PostgreSQL"
type = bool
default = false
default = true
}
Expand Up @@ -55,7 +55,7 @@ func TestMySqlBackupModuleCreateServiceAccount(t *testing.T) {
fmt.Sprintf("instance: %s", instanceName),
fmt.Sprintf("project: %s", projectID),
"- backupTime: ${string(int(sys.now()))}",
fmt.Sprintf("uri: ${\"gs://%s-backup/%[1]s-\" + backupTime + \".sql.gz\"}", instanceName),
fmt.Sprintf("uri: ${\"gs://%s-backup/%[1]s-\" + backupTime + \".sql\"}", instanceName),
}

for _, expected := range backupContainsExpecations {
Expand Down
Expand Up @@ -53,7 +53,7 @@ func TestPostgresqlBackupModuleProvidedServiceAccount(t *testing.T) {
fmt.Sprintf("instance: %s", instanceName),
fmt.Sprintf("project: %s", projectID),
"- backupTime: ${string(int(sys.now()))}",
fmt.Sprintf("uri: ${\"gs://%s-backup/%[1]s-\" + database + \"-\" + backupTime + \".sql\"}", instanceName),
fmt.Sprintf("uri: ${\"gs://%s-backup/%[1]s-\" + database + \"-\" + backupTime + \".sql.gz\"}", instanceName),
}

for _, expected := range backupContainsExpecations {
Expand Down

0 comments on commit ff37244

Please sign in to comment.