Skip to content

Commit

Permalink
feat: Add Point in time recovery flag for mysql DB (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanphalak authored Jun 5, 2024
1 parent 1214bbd commit b9a6ada
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
| 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 |
| 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 |
| availability\_type | The availability type for the master instance. Can be either `REGIONAL` or `null`. | `string` | `"REGIONAL"` | no |
| 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 |
| 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 |
| connector\_enforcement | Enforce that clients use the connector library | `bool` | `false` | no |
| create\_timeout | The optional timout that is applied to limit long database creates. | `string` | `"30m"` | no |
| 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 |
Expand Down
1 change: 1 addition & 0 deletions modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ resource "google_sql_database_instance" "default" {
enabled = local.backups_enabled && var.master_instance_name == null ? true : false
start_time = lookup(backup_configuration.value, "start_time", null)
location = lookup(backup_configuration.value, "location", null)
point_in_time_recovery_enabled = lookup(backup_configuration.value, "point_in_time_recovery_enabled", false)
transaction_log_retention_days = lookup(backup_configuration.value, "transaction_log_retention_days", null)

dynamic "backup_retention_settings" {
Expand Down
1 change: 1 addition & 0 deletions modules/mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ variable "backup_configuration" {
enabled = optional(bool, false)
start_time = optional(string)
location = optional(string)
point_in_time_recovery_enabled = optional(bool, false)
transaction_log_retention_days = optional(string)
retained_backups = optional(number)
retention_unit = optional(string)
Expand Down

0 comments on commit b9a6ada

Please sign in to comment.