Skip to content

Commit

Permalink
feat: Adding flag for enabling data cache in MSSQL module (#642)
Browse files Browse the repository at this point in the history
Co-authored-by: Imran Nayer <imrannayer@google.com>
  • Loading branch information
drewmercer-bl and imrannayer authored Sep 27, 2024
1 parent f59328e commit c9f0014
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/mssql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module "mssql" {
| backup\_configuration | The database backup configuration. | <pre>object({<br> binary_log_enabled = bool<br> enabled = bool<br> point_in_time_recovery_enabled = bool<br> start_time = string<br> transaction_log_retention_days = string<br> retained_backups = number<br> retention_unit = string<br> })</pre> | <pre>{<br> "binary_log_enabled": null,<br> "enabled": false,<br> "point_in_time_recovery_enabled": null,<br> "retained_backups": null,<br> "retention_unit": null,<br> "start_time": null,<br> "transaction_log_retention_days": null<br>}</pre> | no |
| connector\_enforcement | Enforce that clients use the connector library | `bool` | `false` | no |
| create\_timeout | The optional timeout 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 |
| database\_flags | The database flags for the Cloud SQL. See [more details](https://cloud.google.com/sql/docs/sqlserver/flags) | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
| database\_version | The database version to use: SQLSERVER\_2017\_STANDARD, SQLSERVER\_2017\_ENTERPRISE, SQLSERVER\_2017\_EXPRESS, or SQLSERVER\_2017\_WEB | `string` | `"SQLSERVER_2017_STANDARD"` | no |
| db\_charset | The charset for the default database | `string` | `""` | no |
Expand Down
6 changes: 6 additions & 0 deletions modules/mssql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ resource "google_sql_database_instance" "default" {
}
}
}
dynamic "data_cache_config" {
for_each = var.edition == "ENTERPRISE_PLUS" && var.data_cache_enabled ? ["cache_enabled"] : []
content {
data_cache_enabled = var.data_cache_enabled
}
}
dynamic "deny_maintenance_period" {
for_each = local.is_secondary_instance ? [] : var.deny_maintenance_period
content {
Expand Down
6 changes: 6 additions & 0 deletions modules/mssql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ variable "database_flags" {
default = []
}

variable "data_cache_enabled" {
description = "Whether data cache is enabled for the instance. Defaults to false. Feature is only available for ENTERPRISE_PLUS tier and supported database_versions"
type = bool
default = false
}

variable "active_directory_config" {
description = "Active domain that the SQL instance will join."
type = map(string)
Expand Down

0 comments on commit c9f0014

Please sign in to comment.