fix: allow in-place update of skip_wait_for_deletion on group service account

Summary

Fixes #6837 (closed)

When a user adds or changes the skip_wait_for_deletion attribute on an existing gitlab_group_service_account resource, Terraform correctly identifies it as an update (not a replace) — because the attribute has no RequiresReplace plan modifier. However, the Update function was unconditionally returning an error:

Error: Provider Error, report upstream
Somehow the resource was requested to perform an in-place upgrade which is not possible.

Root Cause

skip_wait_for_deletion is a meta-attribute that controls deletion behavior and has no corresponding GitLab API field. All other attributes on this resource have RequiresReplace plan modifiers, so they trigger a destroy+create rather than an update. But skip_wait_for_deletion intentionally does not have RequiresReplace, meaning Terraform will call Update when it changes.

Fix

Implement the Update function to read the plan data and save it to state without making any API calls. This correctly handles the skip_wait_for_deletion attribute update in-place.

Testing

Added TestAcc_GitlabGroupServiceAccount_updateSkipWaitForDeletion which:

  1. Creates a service account with skip_wait_for_deletion = false
  2. Changes it to skip_wait_for_deletion = true
  3. Uses plancheck.ExpectResourceAction to assert an in-place update (not a replace) is performed
  4. Verifies group and username remain unchanged after the update

Merge request reports

Loading