Skip to content

Add group membership management with role-based access control#3

Merged
hameedullah merged 3 commits intomainfrom
copilot/add-user-id-list-support
Feb 3, 2026
Merged

Add group membership management with role-based access control#3
hameedullah merged 3 commits intomainfrom
copilot/add-user-id-list-support

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

Module now supports managing GitLab group members with different access levels (owner, maintainer, developer, reporter, guest).

Changes

Variables (variables.tf)

  • Added members map for flexible configuration with optional expiration dates
  • Added convenience lists: owners, maintainers, developers, reporters, guests
  • All inputs validate user IDs (positive integers) and date formats (YYYY-MM-DD)

Resources (main.tf)

  • Created gitlab_group_membership resources using for_each for each access level
  • Local variables convert user ID lists to sets for efficient management

Outputs (outputs.tf)

  • members: All members with access levels and expiration dates
  • member_count: Total member count
  • member_ids: Distinct list of user IDs

Usage

Simple lists for common use:

module "team" {
  source = "sudo-terraform-modules/groups/gitlab"
  
  name = "backend-team"
  path = "backend-team"
  
  owners      = [101, 102]
  developers  = [301, 302, 303]
}

Advanced configuration with expiration:

module "project" {
  source = "sudo-terraform-modules/groups/gitlab"
  
  name = "project-alpha"
  path = "project-alpha"
  
  owners = [100]
  members = {
    contractor = {
      user_id      = 300
      access_level = "developer"
      expires_at   = "2024-12-31"
    }
  }
}

All new variables default to empty, maintaining backwards compatibility.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 3, 2026 03:18
- Add variables for owners, maintainers, developers, reporters, and guests
- Add flexible members variable for custom access levels with expiration
- Create gitlab_group_membership resources for all access levels
- Add outputs for member information (members, member_count, member_ids)
- Update README with usage examples and documentation

Co-authored-by: hameedullah <59614+hameedullah@users.noreply.github.com>
- Add locals block to prepare user ID sets efficiently
- Reduce code duplication across membership resources
- Improve code readability and maintainability

Co-authored-by: hameedullah <59614+hameedullah@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for user ID list as variable for access roles Add group membership management with role-based access control Feb 3, 2026
Copilot AI requested a review from hameedullah February 3, 2026 03:22
@hameedullah hameedullah marked this pull request as ready for review February 3, 2026 03:32
@hameedullah hameedullah merged commit 65dd27e into main Feb 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants