Skip to content

[Bug] Custom KMS Org policy breaks terraform destroy operations of KMS keys #9

Closed

Description

@aghassemlouei

https://github.com/gcp-stellar-engine/stellar-engine/blob/fac47f0004befddffd81049491f2e6cd27b85742/fast/stages-aw/0-bootstrap/data/custom-constraint-policies/cloudkms.yaml#L14

This constraint fails when terraform tries to delete a key. When the GCP provider deletes a key version, it also explicitly unsets the key rotation period to prevent a new key from being created. See https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/templates/terraform/custom_delete/kms_crypto_key.tmpl

This is due to the unique feature of KMS where it is impossible to delete a keyring or key, key material can only be destroyed.

Currently my only workaround is to disable this constraint if I need to delete a key, or remove the old key from terraform state files. It would be nice if the org policy could handle this challenge gracefully. I submitted a separate issue to potentially modify this behavior within the terraform provider itself, but it looks to be by design, so I am doubtful this will get changed on the provider side. hashicorp/terraform-provider-google#24503

Activity

  1. added
    Level of Effort - LowQuick, well-defined tasks with no unknowns; takes a few hours up to one day to complete
    Priority - HighCritical issues blocking development or users; urgent bugs or core features for release
    Scope - FastRelated to Fabric FAST deployment stages in the fast directory
    on Oct 13, 2026
  2. 2 remaining items

  3. added 2 commits that reference this issue on Oct 20, 2026
    a2e6b18
    9dc9158
  4. added a commit that references this issue on Oct 20, 2026
    70780db
  5. added 8 commits that reference this issue on Oct 20, 2026
    03079a0
    2d27768
    6807456
    f22a660
    3d84609
    cb0f161
    c49b660
    888b0bf
  6. moved this from In Progress to Done in stellar-engineon Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingLevel of Effort - LowQuick, well-defined tasks with no unknowns; takes a few hours up to one day to completePriority - HighCritical issues blocking development or users; urgent bugs or core features for releaseScope - FastRelated to Fabric FAST deployment stages in the fast directory

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions