From ebbd3bd63f1113c4e7212789e34403cc5b064ac7 Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Tue, 7 Jan 2025 12:10:17 +0000 Subject: [PATCH 1/4] fix: bug with validation --- common-dev-assets | 2 +- modules/fscloud/variables.tf | 4 ++-- variables.tf | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common-dev-assets b/common-dev-assets index ffeb38ae..cd5f6cf3 160000 --- a/common-dev-assets +++ b/common-dev-assets @@ -1 +1 @@ -Subproject commit ffeb38ae284999d23c25416b2f19268ca0ff49b8 +Subproject commit cd5f6cf3583de87d96d2bcf6852d9ad7af7a5193 diff --git a/modules/fscloud/variables.tf b/modules/fscloud/variables.tf index d54d554e..3d3656d0 100644 --- a/modules/fscloud/variables.tf +++ b/modules/fscloud/variables.tf @@ -171,8 +171,8 @@ variable "backup_encryption_key_crn" { validation { condition = anytrue([ var.backup_encryption_key_crn == null, - can(regex(".*kms.*", var.kms_key_crn)), - can(regex(".*hs-crypto.*", var.kms_key_crn)), + can(regex(".*kms.*", var.backup_encryption_key_crn)), + can(regex(".*hs-crypto.*", var.backup_encryption_key_crn)), ]) error_message = "Value must be the KMS key CRN from a Key Protect or Hyper Protect Crypto Services instance in one of the supported backup regions." } diff --git a/variables.tf b/variables.tf index 92baf748..871468aa 100644 --- a/variables.tf +++ b/variables.tf @@ -211,8 +211,8 @@ variable "backup_encryption_key_crn" { validation { condition = anytrue([ var.backup_encryption_key_crn == null, - can(regex(".*kms.*", var.kms_key_crn)), - can(regex(".*hs-crypto.*", var.kms_key_crn)), + can(regex(".*kms.*", var.backup_encryption_key_crn)), + can(regex(".*hs-crypto.*", var.backup_encryption_key_crn)), ]) error_message = "Value must be the KMS key CRN from a Key Protect or Hyper Protect Crypto Services instance in one of the supported backup regions." } From 77e82708340f900fa075729b6e2a91871bb01cff Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Tue, 7 Jan 2025 13:35:11 +0000 Subject: [PATCH 2/4] fix: bug with validation --- modules/fscloud/variables.tf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/fscloud/variables.tf b/modules/fscloud/variables.tf index 3d3656d0..09b9b69b 100644 --- a/modules/fscloud/variables.tf +++ b/modules/fscloud/variables.tf @@ -167,15 +167,6 @@ variable "backup_encryption_key_crn" { type = string description = "The CRN of a Key Protect or Hyper Protect Crypto Services encryption key that you want to use for encrypting the disk that holds deployment backups. Applies only if `use_ibm_owned_encryption_key` is false and `use_same_kms_key_for_backups` is false. If no value is passed, and `use_same_kms_key_for_backups` is true, the value of `kms_key_crn` is used. Alternatively set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups)." default = null - - validation { - condition = anytrue([ - var.backup_encryption_key_crn == null, - can(regex(".*kms.*", var.backup_encryption_key_crn)), - can(regex(".*hs-crypto.*", var.backup_encryption_key_crn)), - ]) - error_message = "Value must be the KMS key CRN from a Key Protect or Hyper Protect Crypto Services instance in one of the supported backup regions." - } } variable "use_default_backup_encryption_key" { From 4543f1c080086368b8c3e9df1803c3904c3ee546 Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Tue, 7 Jan 2025 22:31:34 +0000 Subject: [PATCH 3/4] fix: submdoule --- common-dev-assets | 2 +- modules/fscloud/variables.tf | 9 --------- variables.tf | 4 ++-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/common-dev-assets b/common-dev-assets index ffeb38ae..cd5f6cf3 160000 --- a/common-dev-assets +++ b/common-dev-assets @@ -1 +1 @@ -Subproject commit ffeb38ae284999d23c25416b2f19268ca0ff49b8 +Subproject commit cd5f6cf3583de87d96d2bcf6852d9ad7af7a5193 diff --git a/modules/fscloud/variables.tf b/modules/fscloud/variables.tf index d54d554e..09b9b69b 100644 --- a/modules/fscloud/variables.tf +++ b/modules/fscloud/variables.tf @@ -167,15 +167,6 @@ variable "backup_encryption_key_crn" { type = string description = "The CRN of a Key Protect or Hyper Protect Crypto Services encryption key that you want to use for encrypting the disk that holds deployment backups. Applies only if `use_ibm_owned_encryption_key` is false and `use_same_kms_key_for_backups` is false. If no value is passed, and `use_same_kms_key_for_backups` is true, the value of `kms_key_crn` is used. Alternatively set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups)." default = null - - validation { - condition = anytrue([ - var.backup_encryption_key_crn == null, - can(regex(".*kms.*", var.kms_key_crn)), - can(regex(".*hs-crypto.*", var.kms_key_crn)), - ]) - error_message = "Value must be the KMS key CRN from a Key Protect or Hyper Protect Crypto Services instance in one of the supported backup regions." - } } variable "use_default_backup_encryption_key" { diff --git a/variables.tf b/variables.tf index 92baf748..871468aa 100644 --- a/variables.tf +++ b/variables.tf @@ -211,8 +211,8 @@ variable "backup_encryption_key_crn" { validation { condition = anytrue([ var.backup_encryption_key_crn == null, - can(regex(".*kms.*", var.kms_key_crn)), - can(regex(".*hs-crypto.*", var.kms_key_crn)), + can(regex(".*kms.*", var.backup_encryption_key_crn)), + can(regex(".*hs-crypto.*", var.backup_encryption_key_crn)), ]) error_message = "Value must be the KMS key CRN from a Key Protect or Hyper Protect Crypto Services instance in one of the supported backup regions." } From 7713e65e8c97ba7729b1d1dcb9d4ffceb2c827a2 Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Tue, 7 Jan 2025 22:39:49 +0000 Subject: [PATCH 4/4] fix: submdoule --- common-dev-assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-dev-assets b/common-dev-assets index cd5f6cf3..ffeb38ae 160000 --- a/common-dev-assets +++ b/common-dev-assets @@ -1 +1 @@ -Subproject commit cd5f6cf3583de87d96d2bcf6852d9ad7af7a5193 +Subproject commit ffeb38ae284999d23c25416b2f19268ca0ff49b8