terraform-google-modules/terraform-google-kms

Wrong keys map output prevents doing imports

grzegdl opened this issue · 0 comments

This issue prevents doing any imports when kms module is used along with other modules/resources.

Error: Error in function call

  on .terraform/modules/kms/terraform-google-modules-terraform-google-kms-6de47d4/main.tf line 18, in locals:
  18:   keys_by_name = zipmap(var.keys, var.prevent_destroy ? google_kms_crypto_key.key[*].self_link : google_kms_crypto_key.key_ephemeral[*].self_link)
    |----------------
    | google_kms_crypto_key.key is tuple with 1 element
    | google_kms_crypto_key.key_ephemeral is empty tuple
    | var.keys is empty list of string
    | var.prevent_destroy is true

Call to function "zipmap" failed: number of keys (0) does not match number of
values (1).