From 3fbeb7e11515647189b2d3c9001b2d44cf49a93a Mon Sep 17 00:00:00 2001 From: ramneekkh <95204694+ramneekkh@users.noreply.github.com> Date: Wed, 21 Sep 2022 23:19:35 +0800 Subject: [PATCH] feat!: Updated CMEK attribute (#103) * Updated CMEK attribute * Updated minimum provider version to 4.28 where CMEK attributed was added Co-authored-by: Bharath KKB --- README.md | 1 + main.tf | 3 ++- variables.tf | 7 +++++++ versions.tf | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb1f198..4811450 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ module "memorystore" { | auth\_enabled | Indicates whether OSS Redis AUTH is enabled for the instance. If set to true AUTH is enabled on the instance. | `bool` | `false` | no | | authorized\_network | The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used. | `string` | `null` | no | | connect\_mode | The connection mode of the Redis instance. Can be either DIRECT\_PEERING or PRIVATE\_SERVICE\_ACCESS. The default connect mode if not provided is DIRECT\_PEERING. | `string` | `null` | no | +| customer\_managed\_key | Default encryption key to apply to the Redis instance. Defaults to null (Google-managed). | `string` | `null` | no | | display\_name | An arbitrary and optional user-provided name for the instance. | `string` | `null` | no | | enable\_apis | Flag for enabling redis.googleapis.com in your project | `bool` | `true` | no | | labels | The resource labels to represent user provided metadata. | `map(string)` | `null` | no | diff --git a/main.tf b/main.tf index 694cfb0..667ec81 100644 --- a/main.tf +++ b/main.tf @@ -29,7 +29,8 @@ resource "google_redis_instance" "default" { location_id = var.location_id alternative_location_id = var.alternative_location_id - authorized_network = var.authorized_network + authorized_network = var.authorized_network + customer_managed_key = var.customer_managed_key redis_version = var.redis_version redis_configs = var.redis_configs diff --git a/variables.tf b/variables.tf index bcd2ab4..b272320 100644 --- a/variables.tf +++ b/variables.tf @@ -140,3 +140,10 @@ variable "maintenance_policy" { }) default = null } + + +variable "customer_managed_key" { + description = "Default encryption key to apply to the Redis instance. Defaults to null (Google-managed)." + type = string + default = null +} diff --git a/versions.tf b/versions.tf index 634d211..d049c49 100644 --- a/versions.tf +++ b/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.10.0, < 5.0" + version = ">= 4.28.0, < 5.0" } }