User

class User : KotlinCustomResource

The gitlab.User resource allows to manage the lifecycle of a user.

the provider needs to be configured with admin-level access for this resource to work. You must specify either password or reset_password. Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = new gitlab.User("example", {
name: "Example Foo",
username: "example",
password: "superPassword",
email: "gitlab@user.create",
isAdmin: true,
projectsLimit: 4,
canCreateGroup: false,
isExternal: true,
resetPassword: false,
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.User("example",
name="Example Foo",
username="example",
password="superPassword",
email="gitlab@user.create",
is_admin=True,
projects_limit=4,
can_create_group=False,
is_external=True,
reset_password=False)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = new GitLab.User("example", new()
{
Name = "Example Foo",
Username = "example",
Password = "superPassword",
Email = "gitlab@user.create",
IsAdmin = true,
ProjectsLimit = 4,
CanCreateGroup = false,
IsExternal = true,
ResetPassword = false,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.NewUser(ctx, "example", &gitlab.UserArgs{
Name: pulumi.String("Example Foo"),
Username: pulumi.String("example"),
Password: pulumi.String("superPassword"),
Email: pulumi.String("gitlab@user.create"),
IsAdmin: pulumi.Bool(true),
ProjectsLimit: pulumi.Int(4),
CanCreateGroup: pulumi.Bool(false),
IsExternal: pulumi.Bool(true),
ResetPassword: pulumi.Bool(false),
})
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.User;
import com.pulumi.gitlab.UserArgs;
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 example = new User("example", UserArgs.builder()
.name("Example Foo")
.username("example")
.password("superPassword")
.email("gitlab@user.create")
.isAdmin(true)
.projectsLimit(4)
.canCreateGroup(false)
.isExternal(true)
.resetPassword(false)
.build());
}
}
resources:
example:
type: gitlab:User
properties:
name: Example Foo
username: example
password: superPassword
email: gitlab@user.create
isAdmin: true
projectsLimit: 4
canCreateGroup: false
isExternal: true
resetPassword: false

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_user. For example: terraform import { to = gitlab_user.example id = "see CLI command below for ID" } Import using the CLI is supported using the following syntax:

$ pulumi import gitlab:index/user:User You can import a user to terraform state using `<resource> <id>`.

The id must be an integer for the id of the user you want to import, for example:

$ pulumi import gitlab:index/user:User example 42

Properties

Link copied to clipboard
val canCreateGroup: Output<Boolean>?

Boolean, defaults to false. Whether to allow the user to create groups.

Link copied to clipboard
val email: Output<String>

The e-mail address of the user.

Link copied to clipboard
val externalProvider: Output<String>?

String, the external provider.

Link copied to clipboard
val externUid: Output<String>?

String, a specific external authentication provider UID.

Link copied to clipboard

Set user password to a random value

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val isAdmin: Output<Boolean>?

Boolean, defaults to false. Whether to enable administrative privileges

Link copied to clipboard
val isExternal: Output<Boolean>?

Boolean, defaults to false. Whether a user has access only to some internal or private projects. External users can only access projects to which they are explicitly granted access.

Link copied to clipboard
val name: Output<String>

The name of the user.

Link copied to clipboard
val namespaceId: Output<Int>

The ID of the user's namespace.

Link copied to clipboard
val note: Output<String>?

The note associated to the user.

Link copied to clipboard
val password: Output<String>?

The password of the user.

Link copied to clipboard
val projectsLimit: Output<Int>?

Integer, defaults to 0. Number of projects user can create.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resetPassword: Output<Boolean>?

Boolean, defaults to false. Send user password reset link.

Link copied to clipboard

Boolean, defaults to true. Whether to skip confirmation.

Link copied to clipboard
val state: Output<String>?

String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val username: Output<String>

The username of the user.