Skip to content

Commit ec9db5b

Browse files
authored
fix: remove non-required enforced validation for stacks use cases (#567)
1 parent a381180 commit ec9db5b

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

solutions/fully-configurable/variables.tf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ variable "kms_encryption_enabled" {
133133
condition = var.kms_encryption_enabled == true ? (var.existing_kms_instance_crn != null || var.existing_kms_root_key_crn != null) && length(var.kms_endpoint_url) > 0 : true
134134
error_message = "You must provide at least one of 'existing_kms_instance_crn' or 'existing_kms_root_key_crn' and also set the 'kms_endpoint_url' variable if 'kms_encryption_enabled' is set to true."
135135
}
136-
137-
validation {
138-
condition = var.kms_encryption_enabled == false ? (var.existing_kms_root_key_crn == null && var.existing_kms_instance_crn == null && var.kms_endpoint_url == null) : true
139-
error_message = "If 'kms_encryption_enabled' is set to false. You should not pass values for 'existing_kms_instance_crn', 'existing_kms_root_key_crn' or 'kms_endpoint_url'."
140-
}
141136
}
142137

143138
variable "existing_kms_instance_crn" {
@@ -152,22 +147,12 @@ variable "existing_kms_instance_crn" {
152147
])
153148
error_message = "The provided KMS instance CRN in the input 'existing_kms_instance_crn' in not valid."
154149
}
155-
156-
validation {
157-
condition = var.existing_kms_instance_crn != null ? var.existing_event_notifications_instance_crn == null : true
158-
error_message = "A value should not be passed for 'existing_kms_instance_crn' when passing an existing EN instance using the 'existing_event_notifications_instance_crn' input."
159-
}
160150
}
161151

162152
variable "kms_endpoint_url" {
163153
type = string
164154
description = "The KMS endpoint URL to use when you configure KMS encryption. When set to true, a value must be passed for either `existing_kms_root_key_crn` or `existing_kms_instance_crn` (to create a new key). The Hyper Protect Crypto Services endpoint URL format is `https://api.private.<REGION>.hs-crypto.cloud.ibm.com:<port>` and the Key Protect endpoint URL format is `https://<REGION>.kms.cloud.ibm.com`. Not required if passing an existing instance using the `existing_event_notifications_instance_crn` input."
165155
default = null
166-
167-
validation {
168-
condition = var.kms_endpoint_url != null ? var.existing_event_notifications_instance_crn == null : true
169-
error_message = "A value should not be passed for 'kms_endpoint_url' when passing an existing EN instance using the 'existing_event_notifications_instance_crn' input."
170-
}
171156
}
172157

173158
variable "existing_kms_root_key_crn" {

solutions/security-enforced/variables.tf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,19 @@ variable "existing_kms_instance_crn" {
9393
])
9494
error_message = "The provided KMS instance CRN in the input 'existing_kms_instance_crn' in not valid."
9595
}
96-
97-
validation {
98-
condition = var.existing_kms_instance_crn != null ? var.existing_event_notifications_instance_crn == null : true
99-
error_message = "A value should not be passed for 'existing_kms_instance_crn' when passing an existing EN instance using the 'existing_event_notifications_instance_crn' input."
100-
}
10196
}
10297

10398
variable "kms_endpoint_url" {
10499
type = string
105100
description = "The KMS endpoint URL to use when you configure KMS encryption. When set to true, a value must be passed for either `existing_kms_root_key_crn` or `existing_kms_instance_crn` (to create a new key). The Hyper Protect Crypto Services endpoint URL format is `https://api.private.<REGION>.hs-crypto.cloud.ibm.com:<port>` and the Key Protect endpoint URL format is `https://<REGION>.kms.cloud.ibm.com`. Not required if passing an existing instance using the `existing_event_notifications_instance_crn` input."
106101
default = null
107-
108-
validation {
109-
condition = var.kms_endpoint_url != null ? var.existing_event_notifications_instance_crn == null : true
110-
error_message = "A value should not be passed for 'kms_endpoint_url' when passing an existing EN instance using the 'existing_event_notifications_instance_crn' input."
111-
}
112102
}
113103

114104
variable "existing_kms_root_key_crn" {
115105
type = string
116106
description = "The key CRN of a root key which will be used to encrypt the data. To use an existing key you must also provide a value for 'kms_endpoint_url' and 'existing_kms_instance_crn' should be null. If no value passed, a new key will be created in the instance provided in the `existing_kms_instance_crn` input."
117107
default = null
118108

119-
validation {
120-
condition = var.existing_kms_root_key_crn != null ? var.existing_event_notifications_instance_crn == null : true
121-
error_message = "A value should not be passed for 'existing_kms_root_key_crn' when passing an existing EN instance using the 'existing_event_notifications_instance_crn' input."
122-
}
123-
124109
validation {
125110
condition = var.existing_kms_root_key_crn != null ? var.existing_kms_instance_crn == null : true
126111
error_message = "A value should not be passed for 'existing_kms_instance_crn' when passing an existing key value using the 'existing_kms_root_key_crn' input."

0 commit comments

Comments
 (0)