1. Packages
  2. GitLab
  3. API Docs
  4. User
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

gitlab.User

Explore with Pulumi AI

gitlab logo
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

    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", {
        canCreateGroup: false,
        email: "gitlab@user.create",
        isAdmin: true,
        isExternal: true,
        password: "superPassword",
        projectsLimit: 4,
        resetPassword: false,
        username: "example",
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    example = gitlab.User("example",
        can_create_group=False,
        email="gitlab@user.create",
        is_admin=True,
        is_external=True,
        password="superPassword",
        projects_limit=4,
        reset_password=False,
        username="example")
    
    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.NewUser(ctx, "example", &gitlab.UserArgs{
    			CanCreateGroup: pulumi.Bool(false),
    			Email:          pulumi.String("gitlab@user.create"),
    			IsAdmin:        pulumi.Bool(true),
    			IsExternal:     pulumi.Bool(true),
    			Password:       pulumi.String("superPassword"),
    			ProjectsLimit:  pulumi.Int(4),
    			ResetPassword:  pulumi.Bool(false),
    			Username:       pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using GitLab = Pulumi.GitLab;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new GitLab.User("example", new()
        {
            CanCreateGroup = false,
            Email = "gitlab@user.create",
            IsAdmin = true,
            IsExternal = true,
            Password = "superPassword",
            ProjectsLimit = 4,
            ResetPassword = false,
            Username = "example",
        });
    
    });
    
    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()        
                .canCreateGroup(false)
                .email("gitlab@user.create")
                .isAdmin(true)
                .isExternal(true)
                .password("superPassword")
                .projectsLimit(4)
                .resetPassword(false)
                .username("example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: gitlab:User
        properties:
          canCreateGroup: false
          email: gitlab@user.create
          isAdmin: true
          isExternal: true
          password: superPassword
          projectsLimit: 4
          resetPassword: false
          username: example
    

    Create User Resource

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             can_create_group: Optional[bool] = None,
             email: Optional[str] = None,
             is_admin: Optional[bool] = None,
             is_external: Optional[bool] = None,
             name: Optional[str] = None,
             namespace_id: Optional[int] = None,
             note: Optional[str] = None,
             password: Optional[str] = None,
             projects_limit: Optional[int] = None,
             reset_password: Optional[bool] = None,
             skip_confirmation: Optional[bool] = None,
             state: Optional[str] = None,
             username: Optional[str] = None)
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: gitlab:User
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    User Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The User resource accepts the following input properties:

    Email string
    The e-mail address of the user.
    Username string
    The username of the user.
    CanCreateGroup bool
    Boolean, defaults to false. Whether to allow the user to create groups.
    IsAdmin bool
    Boolean, defaults to false. Whether to enable administrative privileges
    IsExternal bool
    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.
    Name string
    The name of the user.
    NamespaceId int
    The ID of the user's namespace. Available since GitLab 14.10.
    Note string
    The note associated to the user.
    Password string
    The password of the user.
    ProjectsLimit int
    Integer, defaults to 0. Number of projects user can create.
    ResetPassword bool
    Boolean, defaults to false. Send user password reset link.
    SkipConfirmation bool
    Boolean, defaults to true. Whether to skip confirmation.
    State string
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    Email string
    The e-mail address of the user.
    Username string
    The username of the user.
    CanCreateGroup bool
    Boolean, defaults to false. Whether to allow the user to create groups.
    IsAdmin bool
    Boolean, defaults to false. Whether to enable administrative privileges
    IsExternal bool
    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.
    Name string
    The name of the user.
    NamespaceId int
    The ID of the user's namespace. Available since GitLab 14.10.
    Note string
    The note associated to the user.
    Password string
    The password of the user.
    ProjectsLimit int
    Integer, defaults to 0. Number of projects user can create.
    ResetPassword bool
    Boolean, defaults to false. Send user password reset link.
    SkipConfirmation bool
    Boolean, defaults to true. Whether to skip confirmation.
    State string
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    email String
    The e-mail address of the user.
    username String
    The username of the user.
    canCreateGroup Boolean
    Boolean, defaults to false. Whether to allow the user to create groups.
    isAdmin Boolean
    Boolean, defaults to false. Whether to enable administrative privileges
    isExternal 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.
    name String
    The name of the user.
    namespaceId Integer
    The ID of the user's namespace. Available since GitLab 14.10.
    note String
    The note associated to the user.
    password String
    The password of the user.
    projectsLimit Integer
    Integer, defaults to 0. Number of projects user can create.
    resetPassword Boolean
    Boolean, defaults to false. Send user password reset link.
    skipConfirmation Boolean
    Boolean, defaults to true. Whether to skip confirmation.
    state String
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    email string
    The e-mail address of the user.
    username string
    The username of the user.
    canCreateGroup boolean
    Boolean, defaults to false. Whether to allow the user to create groups.
    isAdmin boolean
    Boolean, defaults to false. Whether to enable administrative privileges
    isExternal 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.
    name string
    The name of the user.
    namespaceId number
    The ID of the user's namespace. Available since GitLab 14.10.
    note string
    The note associated to the user.
    password string
    The password of the user.
    projectsLimit number
    Integer, defaults to 0. Number of projects user can create.
    resetPassword boolean
    Boolean, defaults to false. Send user password reset link.
    skipConfirmation boolean
    Boolean, defaults to true. Whether to skip confirmation.
    state string
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    email str
    The e-mail address of the user.
    username str
    The username of the user.
    can_create_group bool
    Boolean, defaults to false. Whether to allow the user to create groups.
    is_admin bool
    Boolean, defaults to false. Whether to enable administrative privileges
    is_external bool
    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.
    name str
    The name of the user.
    namespace_id int
    The ID of the user's namespace. Available since GitLab 14.10.
    note str
    The note associated to the user.
    password str
    The password of the user.
    projects_limit int
    Integer, defaults to 0. Number of projects user can create.
    reset_password bool
    Boolean, defaults to false. Send user password reset link.
    skip_confirmation bool
    Boolean, defaults to true. Whether to skip confirmation.
    state str
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    email String
    The e-mail address of the user.
    username String
    The username of the user.
    canCreateGroup Boolean
    Boolean, defaults to false. Whether to allow the user to create groups.
    isAdmin Boolean
    Boolean, defaults to false. Whether to enable administrative privileges
    isExternal 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.
    name String
    The name of the user.
    namespaceId Number
    The ID of the user's namespace. Available since GitLab 14.10.
    note String
    The note associated to the user.
    password String
    The password of the user.
    projectsLimit Number
    Integer, defaults to 0. Number of projects user can create.
    resetPassword Boolean
    Boolean, defaults to false. Send user password reset link.
    skipConfirmation Boolean
    Boolean, defaults to true. Whether to skip confirmation.
    state String
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing User Resource

    Get an existing User resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            can_create_group: Optional[bool] = None,
            email: Optional[str] = None,
            is_admin: Optional[bool] = None,
            is_external: Optional[bool] = None,
            name: Optional[str] = None,
            namespace_id: Optional[int] = None,
            note: Optional[str] = None,
            password: Optional[str] = None,
            projects_limit: Optional[int] = None,
            reset_password: Optional[bool] = None,
            skip_confirmation: Optional[bool] = None,
            state: Optional[str] = None,
            username: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CanCreateGroup bool
    Boolean, defaults to false. Whether to allow the user to create groups.
    Email string
    The e-mail address of the user.
    IsAdmin bool
    Boolean, defaults to false. Whether to enable administrative privileges
    IsExternal bool
    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.
    Name string
    The name of the user.
    NamespaceId int
    The ID of the user's namespace. Available since GitLab 14.10.
    Note string
    The note associated to the user.
    Password string
    The password of the user.
    ProjectsLimit int
    Integer, defaults to 0. Number of projects user can create.
    ResetPassword bool
    Boolean, defaults to false. Send user password reset link.
    SkipConfirmation bool
    Boolean, defaults to true. Whether to skip confirmation.
    State string
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    Username string
    The username of the user.
    CanCreateGroup bool
    Boolean, defaults to false. Whether to allow the user to create groups.
    Email string
    The e-mail address of the user.
    IsAdmin bool
    Boolean, defaults to false. Whether to enable administrative privileges
    IsExternal bool
    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.
    Name string
    The name of the user.
    NamespaceId int
    The ID of the user's namespace. Available since GitLab 14.10.
    Note string
    The note associated to the user.
    Password string
    The password of the user.
    ProjectsLimit int
    Integer, defaults to 0. Number of projects user can create.
    ResetPassword bool
    Boolean, defaults to false. Send user password reset link.
    SkipConfirmation bool
    Boolean, defaults to true. Whether to skip confirmation.
    State string
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    Username string
    The username of the user.
    canCreateGroup Boolean
    Boolean, defaults to false. Whether to allow the user to create groups.
    email String
    The e-mail address of the user.
    isAdmin Boolean
    Boolean, defaults to false. Whether to enable administrative privileges
    isExternal 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.
    name String
    The name of the user.
    namespaceId Integer
    The ID of the user's namespace. Available since GitLab 14.10.
    note String
    The note associated to the user.
    password String
    The password of the user.
    projectsLimit Integer
    Integer, defaults to 0. Number of projects user can create.
    resetPassword Boolean
    Boolean, defaults to false. Send user password reset link.
    skipConfirmation Boolean
    Boolean, defaults to true. Whether to skip confirmation.
    state String
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    username String
    The username of the user.
    canCreateGroup boolean
    Boolean, defaults to false. Whether to allow the user to create groups.
    email string
    The e-mail address of the user.
    isAdmin boolean
    Boolean, defaults to false. Whether to enable administrative privileges
    isExternal 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.
    name string
    The name of the user.
    namespaceId number
    The ID of the user's namespace. Available since GitLab 14.10.
    note string
    The note associated to the user.
    password string
    The password of the user.
    projectsLimit number
    Integer, defaults to 0. Number of projects user can create.
    resetPassword boolean
    Boolean, defaults to false. Send user password reset link.
    skipConfirmation boolean
    Boolean, defaults to true. Whether to skip confirmation.
    state string
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    username string
    The username of the user.
    can_create_group bool
    Boolean, defaults to false. Whether to allow the user to create groups.
    email str
    The e-mail address of the user.
    is_admin bool
    Boolean, defaults to false. Whether to enable administrative privileges
    is_external bool
    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.
    name str
    The name of the user.
    namespace_id int
    The ID of the user's namespace. Available since GitLab 14.10.
    note str
    The note associated to the user.
    password str
    The password of the user.
    projects_limit int
    Integer, defaults to 0. Number of projects user can create.
    reset_password bool
    Boolean, defaults to false. Send user password reset link.
    skip_confirmation bool
    Boolean, defaults to true. Whether to skip confirmation.
    state str
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    username str
    The username of the user.
    canCreateGroup Boolean
    Boolean, defaults to false. Whether to allow the user to create groups.
    email String
    The e-mail address of the user.
    isAdmin Boolean
    Boolean, defaults to false. Whether to enable administrative privileges
    isExternal 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.
    name String
    The name of the user.
    namespaceId Number
    The ID of the user's namespace. Available since GitLab 14.10.
    note String
    The note associated to the user.
    password String
    The password of the user.
    projectsLimit Number
    Integer, defaults to 0. Number of projects user can create.
    resetPassword Boolean
    Boolean, defaults to false. Send user password reset link.
    skipConfirmation Boolean
    Boolean, defaults to true. Whether to skip confirmation.
    state String
    String, defaults to 'active'. The state of the user account. Valid values are active, deactivated, blocked.
    username String
    The username of the user.

    Import

    $ 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
    

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi