Skip to content

Commit 57247dd

Browse files
committed
remove 'use_default_backup_encryption_key' from sec-enf, update validation
1 parent e5b1eeb commit 57247dd

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

ibm_catalog.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,6 @@
631631
{
632632
"key": "existing_backup_kms_key_crn"
633633
},
634-
{
635-
"key": "use_default_backup_encryption_key"
636-
},
637634
{
638635
"key": "elasticsearch_key_ring_name"
639636
},

solutions/fully-configurable/variables.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,15 @@ variable "kms_encryption_enabled" {
233233
default = false
234234

235235
validation {
236-
condition = var.kms_encryption_enabled ? var.existing_kms_instance_crn != null || var.existing_kms_key_crn != null || var.existing_backup_kms_key_crn != null : true
237-
error_message = "When variable `kms_encryption_enabled` is true and KMS encryption is enabled, you must provide either an existing KMS instance with variable `existing_kms_instance_crn` or an existing KMS key using variable `existing_kms_key_crn` or `existing_backup_kms_key_crn`"
236+
condition = (
237+
var.existing_elasticsearch_instance_crn != null ||
238+
(var.kms_encryption_enabled && (
239+
var.existing_kms_instance_crn != null ||
240+
var.existing_kms_key_crn != null ||
241+
var.existing_backup_kms_key_crn != null
242+
))
243+
)
244+
error_message = "When setting values for 'existing_kms_instance_crn', 'existing_kms_key_crn' or 'existing_backup_kms_key_crn', the 'kms_encryption_enabled' input must be set to true."
238245
}
239246
}
240247

solutions/security-enforced/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module "elasticsearch" {
3131
existing_kms_instance_crn = var.existing_kms_instance_crn
3232
existing_kms_key_crn = var.existing_kms_key_crn
3333
existing_backup_kms_key_crn = var.existing_backup_kms_key_crn
34-
use_default_backup_encryption_key = var.use_default_backup_encryption_key
34+
use_default_backup_encryption_key = false
3535
kms_endpoint_type = "private"
3636
skip_es_kms_auth_policy = var.skip_es_kms_auth_policy
3737
elasticsearch_key_ring_name = var.elasticsearch_key_ring_name

solutions/security-enforced/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,6 @@ variable "existing_backup_kms_key_crn" {
250250
}
251251
}
252252

253-
variable "use_default_backup_encryption_key" {
254-
type = bool
255-
description = "When `use_ibm_owned_encryption_key` is set to false, backups will be encrypted with either the key specified in `existing_kms_key_crn`, in `existing_backup_kms_key_crn`, or with a new key that will be created in the instance specified in the `existing_kms_instance_crn` input. If you do not want to use your own key for backups encryption, you can set this to `true` to use the IBM Cloud Databases default encryption for backups. Alternatively set `use_ibm_owned_encryption_key` to true to use the default encryption for both backups and deployment data."
256-
default = false
257-
}
258-
259253
variable "skip_es_kms_auth_policy" {
260254
type = bool
261255
description = "Set to true to skip the creation of IAM authorization policies that permits all Databases for Elasticsearch instances in the given resource group 'Reader' access to the Key Protect or Hyper Protect Crypto Services key. This policy is required in order to enable KMS encryption, so only skip creation if there is one already present in your account. No policy is created if `use_ibm_owned_encryption_key` is true."

0 commit comments

Comments
 (0)