terraform-provider-gitlab
terraform-provider-gitlab copied to clipboard
destroying gitlab_deploy_key_enable also destroys gitlab_deploy_key
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.
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