Skip to content

Commit

Permalink
feat: Add location support to backup_configuration block (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelthor committed Aug 10, 2020
1 parent 2bd0f41 commit aa907bd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/mysql-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module "mysql" {
enabled = true
binary_log_enabled = true
start_time = "20:55"
location = null
}

// Read replica configurations
Expand Down
1 change: 1 addition & 0 deletions examples/postgresql-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module "pg" {
backup_configuration = {
enabled = true
start_time = "20:55"
location = null
}

// Read replica configurations
Expand Down
1 change: 1 addition & 0 deletions modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ resource "google_sql_database_instance" "default" {
binary_log_enabled = local.binary_log_enabled
enabled = local.backups_enabled
start_time = lookup(backup_configuration.value, "start_time", null)
location = lookup(backup_configuration.value, "location", null)
}
}
dynamic "ip_configuration" {
Expand Down
2 changes: 2 additions & 0 deletions modules/mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ variable "backup_configuration" {
binary_log_enabled = bool
enabled = bool
start_time = string
location = string
})
default = {
binary_log_enabled = false
enabled = false
start_time = null
location = null
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ resource "google_sql_database_instance" "default" {
binary_log_enabled = false
enabled = lookup(backup_configuration.value, "enabled", null)
start_time = lookup(backup_configuration.value, "start_time", null)
location = lookup(backup_configuration.value, "location", null)
}
}
dynamic "ip_configuration" {
Expand Down
2 changes: 2 additions & 0 deletions modules/postgresql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ variable "backup_configuration" {
type = object({
enabled = bool
start_time = string
location = string
})
default = {
enabled = false
start_time = null
location = null
}
}

Expand Down
2 changes: 2 additions & 0 deletions modules/safer_mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ variable "backup_configuration" {
binary_log_enabled = bool
enabled = bool
start_time = string
location = string
})
default = {
binary_log_enabled = false
enabled = false
start_time = null
location = null
}
}

Expand Down

0 comments on commit aa907bd

Please sign in to comment.