Skip to content

KMS key should be ignored when existing DB instance is used #276

@in-1911

Description

@in-1911

When the module is called with passing existing_db_instance_crn, the KMS key should be ignored completely.

Otherwise the validation fails with an error:

...
existing_db_instance_crn = "<valid DB instance CRN"
existing_kms_key_crn =  null
...
 2024/09/06 16:24:38 Terraform plan | 
 2024/09/06 16:24:38 Terraform plan |   on main.tf line 14, in locals:
 2024/09/06 16:24:38 Terraform plan |   14:   kms_key_crn = var.existing_kms_key_crn != null ? var.existing_kms_key_crn : module.kms[0].keys[format("%!s(MISSING).%!s(MISSING)", local.elasticsearch_key_ring_name, local.elasticsearch_key_name)].crn
 2024/09/06 16:24:38 Terraform plan |     ├────────────────
 2024/09/06 16:24:38 Terraform plan |     │ module.kms is empty tuple
 2024/09/06 16:24:38 Terraform plan | 
 2024/09/06 16:24:38 Terraform plan | The given key does not identify an element in this collection value: the
 2024/09/06 16:24:38 Terraform plan | collection has no elements.

kms_key_crn = var.existing_kms_key_crn != null ? var.existing_kms_key_crn : module.kms[0].keys[format("%s.%s", local.elasticsearch_key_ring_name, local.elasticsearch_key_name)].crn

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions