The gitlab_project_membership
resource allows to manage the lifecycle of a users project membership.
Upstream API: GitLab REST API docs
resource "gitlab_project_membership" "test" {
project = "12345"
user_id = 1337
access_level = "guest"
}
resource "gitlab_project_membership" "example" {
project = "67890"
user_id = 1234
access_level = "guest"
expires_at = "2022-12-31"
}
access_level
(String) The access level for the member. Valid values are: no one
, minimal
, guest
, reporter
, developer
, maintainer
, owner
, master
project
(String) The ID or URL-encoded path of the project.user_id
(Number) The id of the user.expires_at
(String) Expiration date for the project membership. Format: YYYY-MM-DD
id
(String) The ID of this resource.Import is supported using the following syntax:
# GitLab project membership can be imported using an id made up of `project_id:user_id`, e.g.
terraform import gitlab_project_membership.test "12345:1337"