Group Membership
The gitlab.GroupMembership
resource allows to manage the lifecycle of a users group membership.
If a group should grant membership to another group use the
gitlab.GroupShareGroup
resource instead. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const test = new gitlab.GroupMembership("test", {
accessLevel: "guest",
expiresAt: "2020-12-31",
groupId: "12345",
userId: 1337,
});
import pulumi
import pulumi_gitlab as gitlab
test = gitlab.GroupMembership("test",
access_level="guest",
expires_at="2020-12-31",
group_id="12345",
user_id=1337)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var test = new GitLab.GroupMembership("test", new()
{
AccessLevel = "guest",
ExpiresAt = "2020-12-31",
GroupId = "12345",
UserId = 1337,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewGroupMembership(ctx, "test", &gitlab.GroupMembershipArgs{
AccessLevel: pulumi.String("guest"),
ExpiresAt: pulumi.String("2020-12-31"),
GroupId: pulumi.String("12345"),
UserId: pulumi.Int(1337),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GroupMembership;
import com.pulumi.gitlab.GroupMembershipArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new GroupMembership("test", GroupMembershipArgs.builder()
.accessLevel("guest")
.expiresAt("2020-12-31")
.groupId("12345")
.userId(1337)
.build());
}
}
resources:
test:
type: gitlab:GroupMembership
properties:
accessLevel: guest
expiresAt: 2020-12-31
groupId: '12345'
userId: 1337
Import
GitLab group membership can be imported using an id made up of group_id:user_id
, e.g.
$ pulumi import gitlab:index/groupMembership:GroupMembership test "12345:1337"
Properties
Access level for the member. Valid values are: no one
, minimal
, guest
, reporter
, developer
, maintainer
, owner
, master
.
The ID of a custom member role. Only available for Ultimate instances.
Whether the deletion of direct memberships of the removed member in subgroups and projects should be skipped. Only used during a destroy.
Whether the removed member should be unassigned from any issues or merge requests inside a given group or project. Only used during a destroy.