Skip to content

Commit b9a6ada

Browse files
authored
feat: Add Point in time recovery flag for mysql DB (#607)
1 parent 1214bbd commit b9a6ada

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

modules/mysql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
1111
| additional\_databases | A list of databases to be created in your cluster | <pre>list(object({<br> name = string<br> charset = string<br> collation = string<br> }))</pre> | `[]` | no |
1212
| additional\_users | A list of users to be created in your cluster. A random password would be set for the user if the `random_password` variable is set. | <pre>list(object({<br> name = string<br> password = string<br> random_password = bool<br> type = string<br> host = string<br> }))</pre> | `[]` | no |
1313
| availability\_type | The availability type for the master instance. Can be either `REGIONAL` or `null`. | `string` | `"REGIONAL"` | no |
14-
| backup\_configuration | The backup\_configuration settings subblock for the database setings | <pre>object({<br> binary_log_enabled = optional(bool, false)<br> enabled = optional(bool, false)<br> start_time = optional(string)<br> location = optional(string)<br> transaction_log_retention_days = optional(string)<br> retained_backups = optional(number)<br> retention_unit = optional(string)<br> })</pre> | `{}` | no |
14+
| backup\_configuration | The backup\_configuration settings subblock for the database setings | <pre>object({<br> binary_log_enabled = optional(bool, false)<br> enabled = optional(bool, false)<br> start_time = optional(string)<br> location = optional(string)<br> point_in_time_recovery_enabled = optional(bool, false)<br> transaction_log_retention_days = optional(string)<br> retained_backups = optional(number)<br> retention_unit = optional(string)<br> })</pre> | `{}` | no |
1515
| connector\_enforcement | Enforce that clients use the connector library | `bool` | `false` | no |
1616
| create\_timeout | The optional timout that is applied to limit long database creates. | `string` | `"30m"` | no |
1717
| data\_cache\_enabled | Whether data cache is enabled for the instance. Defaults to false. Feature is only available for ENTERPRISE\_PLUS tier and supported database\_versions | `bool` | `false` | no |

modules/mysql/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ resource "google_sql_database_instance" "default" {
7676
enabled = local.backups_enabled && var.master_instance_name == null ? true : false
7777
start_time = lookup(backup_configuration.value, "start_time", null)
7878
location = lookup(backup_configuration.value, "location", null)
79+
point_in_time_recovery_enabled = lookup(backup_configuration.value, "point_in_time_recovery_enabled", false)
7980
transaction_log_retention_days = lookup(backup_configuration.value, "transaction_log_retention_days", null)
8081

8182
dynamic "backup_retention_settings" {

modules/mysql/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ variable "backup_configuration" {
205205
enabled = optional(bool, false)
206206
start_time = optional(string)
207207
location = optional(string)
208+
point_in_time_recovery_enabled = optional(bool, false)
208209
transaction_log_retention_days = optional(string)
209210
retained_backups = optional(number)
210211
retention_unit = optional(string)

0 commit comments

Comments
 (0)