terraform-provider-gitlab icon indicating copy to clipboard operation
terraform-provider-gitlab copied to clipboard

destroying gitlab_deploy_key_enable also destroys gitlab_deploy_key

Open nderraugh opened this issue 2 years ago • 1 comments

Terraform Version

Terraform v1.0.5 on darwin_amd64

  • provider registry.terraform.io/gitlabhq/gitlab v3.7.0
  • provider registry.terraform.io/hashicorp/tls v3.1.0

Affected Resource(s)

Please list the resources as a list, for example: -gitlab_deploy_key -gitlab_deploy_key_enable

Expected Behavior

Destroying an gitlab_deploy_key_enable should not delete its associated gitlab_deploy_key.

Actual Behavior

gitlab_deploy_key_enable gets destroyed which seems to implicitly destroy the gitlab_deploy_key, which that has to be removed from state in a separate operation before the intent of the original plan can be reconciled.

nderraugh avatar Sep 01 '21 00:09 nderraugh

The problem here is that the gitlab_deploy_key_enable resource explicitly deletes the Deploy Key during the destroy 🤷 (not sure if that was by intention, ...)

However, there isn't a disable API and I'm not really convinced yet that it's even possible to disable it at all. I've created an upstream issue here: https://gitlab.com/gitlab-org/gitlab/-/issues/352631

timofurrer avatar Feb 11 '22 18:02 timofurrer