Skip to content

Fix gitlab_deploy_token.username during resource creation

Currently, when creating a new gitlab_deploy_token resource with the (optional) username attribute not specified, then the resultant state's username attribute value is null.

This is despite the fact that the GitLab APIs POST /projects/:id/deploy_tokens (docs) and POST /groups/:id/deploy_tokens (docs) do indeed return a (generated) value for the username attribute.

Please see https://gitlab.com/theipster/terraform-provider-gitlab/-/pipelines/884877003 for the failing test that replicates the issue.

This merge request fixes the create method by populating the username attribute using the value from the API response.

Edited by Alan Ip

Merge request reports

Loading