Skip to content

Commit d386fdd

Browse files
authored
fix: fixed bug with COS KMS key logic (#222)
1 parent d5709b8 commit d386fdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

solutions/standard/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module "kms" {
7474
locals {
7575
# tflint-ignore: terraform_unused_declarations
7676
validate_cos_regions = var.cos_bucket_region != null && var.cross_region_location != null ? tobool("Cannot provide values for var.cos_bucket_region and var.cross_region_location") : true
77-
cos_kms_key_crn = var.existing_cos_bucket_name != null ? null : local.existing_kms_root_key_id != null ? local.existing_kms_root_key_id : module.kms[0].keys[format("%s.%s", var.cos_key_ring_name, var.cos_key_name)].crn
77+
cos_kms_key_crn = var.existing_cos_bucket_name != null ? null : var.existing_kms_root_key_crn != null ? var.existing_kms_root_key_crn : module.kms[0].keys[format("%s.%s", var.cos_key_ring_name, var.cos_key_name)].crn
7878
cos_instance_guid = var.existing_cos_instance_crn != null ? element(split(":", var.existing_cos_instance_crn), length(split(":", var.existing_cos_instance_crn)) - 3) : module.cos.cos_instance_guid
7979
cos_bucket_name = var.existing_cos_bucket_name != null ? var.existing_cos_bucket_name : module.cos.bucket_name
8080
cos_bucket_region = var.cos_bucket_region != null ? var.cos_bucket_region : var.cross_region_location != null ? null : var.region

0 commit comments

Comments
 (0)