Hi @arun-a-nayagam,
I’m not familiar with this particular data source, but it seems like what’s happened here is that it is returning an id
attribute set to null
, which Terraform is then understanding as you wanting to leave crypto_key_id
unset (because that’s what null
represents in a resource configuration).
However, that’s a pretty unusual thing for a data source to do, and I can’t see any case where that should be true in the implementation of this data source:
So I think something else is happening here, but I’m not sure what exactly it is. I think to understand better what’s happening it would help to see the exact values that this data resource is returning. One way to achieve that could be to temporarily comment out your resource "google_kms_crypto_key_iam_binding" "disk"
block, to prevent the error, and then apply the result just so that the data resource results will be recorded in the current state, and then you can hopefully use terraform console
to inspect its values by typing just data.google_kms_crypto_key.disk
at the console prompt.