terraform-ibm-modules / terraform-ibm-cos

Configures an IBM Cloud Object Storage instance and bucket
Apache License 2.0
7 stars 24 forks source link

COS bucket KMS de-register race condition #672

Closed ocofaigh closed 1 month ago

ocofaigh commented 1 month ago

When a KMS encrypted COS bucket is deletes it kicks off a process to de-register from the KMS key BUT it does not wait until de-registration occurs. Since it does not wait, there is a race condition that can occur where the auth policy can be deleted before the de-registration completes, meaning the KMS key cannot be deleted.

As a workaround, suggest updating the time sleep we have to also wait on destroy

ocofaigh commented 1 month ago

https://github.com/terraform-ibm-modules/terraform-ibm-cos/pull/673