Skip to content

Commit

Permalink
feat: Added "encryption_key_name" variable for postgresql and mysql m…
Browse files Browse the repository at this point in the history
…odules. (#101)

* Added "encryption_key_name" variable for postgresql and mysql modules and "availability_type" variable for mysql

* Added "encryption_key_name" variable for postgresql and mysql modules and "availability_type" variable for mysql

* Added "encryption_key_name" variable for postgresql and mysql modules and "availability_type" variable for mysql

Co-authored-by: Cezar Romaniuc <cezar.romaniuc@gmail.com>
  • Loading branch information
cromaniuc and Cezar Romaniuc committed Apr 24, 2020
1 parent 5138365 commit cf87a9d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions modules/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
| disk\_autoresize | Configuration to increase storage size | bool | `"true"` | no |
| disk\_size | The disk size for the master instance | number | `"10"` | no |
| disk\_type | The disk type for the master instance. | string | `"PD_SSD"` | no |
| encryption\_key\_name | The full path to the encryption key used for the CMEK disk encryption | string | `"null"` | no |
| failover\_replica | Specify true if the failover instance is required | bool | `"false"` | no |
| failover\_replica\_activation\_policy | The activation policy for the failover replica instance. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`. | string | `"ALWAYS"` | no |
| failover\_replica\_configuration | The replica configuration for the failover replica instance. In order to create a failover instance, need to specify this argument. | object | `<map>` | no |
Expand Down
10 changes: 6 additions & 4 deletions modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ locals {
}

resource "google_sql_database_instance" "default" {
project = var.project_id
name = var.name
database_version = var.database_version
region = var.region
provider = google-beta
project = var.project_id
name = var.name
database_version = var.database_version
region = var.region
encryption_key_name = var.encryption_key_name

settings {
tier = var.tier
Expand Down
6 changes: 6 additions & 0 deletions modules/mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ variable "delete_timeout" {
default = "10m"
}

variable "encryption_key_name" {
description = "The full path to the encryption key used for the CMEK disk encryption"
type = string
default = null
}

variable "module_depends_on" {
description = "List of modules or resources this module depends on."
type = list(any)
Expand Down
1 change: 1 addition & 0 deletions modules/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
| disk\_autoresize | Configuration to increase storage size. | bool | `"true"` | no |
| disk\_size | The disk size for the master instance. | string | `"10"` | no |
| disk\_type | The disk type for the master instance. | string | `"PD_SSD"` | no |
| encryption\_key\_name | The full path to the encryption key used for the CMEK disk encryption | string | `"null"` | no |
| ip\_configuration | The ip configuration for the master instances. | object | `<map>` | no |
| maintenance\_window\_day | The day of week (1-7) for the master instance maintenance. | number | `"1"` | no |
| maintenance\_window\_hour | The hour of day (0-23) maintenance window for the master instance maintenance. | number | `"23"` | no |
Expand Down
10 changes: 6 additions & 4 deletions modules/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ locals {
}

resource "google_sql_database_instance" "default" {
project = var.project_id
name = var.name
database_version = var.database_version
region = var.region
provider = google-beta
project = var.project_id
name = var.name
database_version = var.database_version
region = var.region
encryption_key_name = var.encryption_key_name

settings {
tier = var.tier
Expand Down
7 changes: 7 additions & 0 deletions modules/postgresql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,15 @@ variable "delete_timeout" {
default = "10m"
}

variable "encryption_key_name" {
description = "The full path to the encryption key used for the CMEK disk encryption"
type = string
default = null
}

variable "module_depends_on" {
description = "List of modules or resources this module depends on."
type = list(any)
default = []
}

0 comments on commit cf87a9d

Please sign in to comment.