You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
existing_kms_guid=var.existing_kms_crn!=null?element(split(":", var.existing_kms_crn), length(split(":", var.existing_kms_crn)) -3) :length(local.bucket_config_map) ==2?null:tobool("The CRN of the existing KMS is not provided.")
count=(var.existing_cos_kms_key_crn!=null|| (var.existing_log_archive_cos_bucket_name!=null&& var.existing_at_cos_target_bucket_name!=null)) ?0:1# no need to create any KMS resources if passing an existing key, or bucket
130
+
count=(var.existing_cos_kms_key_crn!=null|| (length(local.bucket_config_map) ==0)) ?0:1# no need to create any KMS resources if passing an existing key, or bucket
# The auth policy is being created here instead of in COS module because of this limitation: https://github.com/terraform-ibm-modules/terraform-ibm-observability-da/issues/8
168
+
169
+
# Create IAM Authorization Policy to allow COS to access KMS for the encryption key
description="Allow the COS instance with GUID ${local.cos_instance_guid} reader access to the kms_service instance GUID ${local.existing_kms_guid}"
178
+
}
179
+
180
+
module"cos_instance" {
155
181
providers={
156
182
ibm = ibm.cos
157
183
}
158
-
count=(var.existing_log_archive_cos_bucket_name==null|| var.existing_at_cos_target_bucket_name==null) ?1:0# no need to call COS module if consumer is passing existing COS bucket
184
+
count=(var.existing_cos_instance_crn==null) ?1:0# no need to call COS module if consumer is using existing COS instance
Copy file name to clipboardExpand all lines: solutions/instances/variables.tf
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -251,10 +251,10 @@ variable "kms_region" {
251
251
description="The region in which KMS instance exists."
252
252
}
253
253
254
-
variable"existing_kms_guid" {
254
+
variable"existing_kms_crn" {
255
255
type=string
256
256
default=null
257
-
description="The GUID of of the KMS instance used for the COS bucket root Key. Only required if not supplying an existing KMS root key and if 'skip_cos_kms_auth_policy' is true."
257
+
description="The CRN of the KMS instance used for the COS bucket root Key. Only required if not supplying an existing KMS root key and if 'skip_cos_kms_auth_policy' is true."
0 commit comments