gitlab.User
Explore with Pulumi AI
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)
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
})
}
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 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
Create User Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
args: UserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def User(resource_name: str,
opts: Optional[ResourceOptions] = None,
username: Optional[str] = None,
email: Optional[str] = None,
name: Optional[str] = None,
external_provider: Optional[str] = None,
is_admin: Optional[bool] = None,
is_external: Optional[bool] = None,
can_create_group: Optional[bool] = 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,
extern_uid: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: gitlab:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var userResource = new GitLab.User("userResource", new()
{
Username = "string",
Email = "string",
Name = "string",
ExternalProvider = "string",
IsAdmin = false,
IsExternal = false,
CanCreateGroup = false,
NamespaceId = 0,
Note = "string",
Password = "string",
ProjectsLimit = 0,
ResetPassword = false,
SkipConfirmation = false,
State = "string",
ExternUid = "string",
});
example, err := gitlab.NewUser(ctx, "userResource", &gitlab.UserArgs{
Username: pulumi.String("string"),
Email: pulumi.String("string"),
Name: pulumi.String("string"),
ExternalProvider: pulumi.String("string"),
IsAdmin: pulumi.Bool(false),
IsExternal: pulumi.Bool(false),
CanCreateGroup: pulumi.Bool(false),
NamespaceId: pulumi.Int(0),
Note: pulumi.String("string"),
Password: pulumi.String("string"),
ProjectsLimit: pulumi.Int(0),
ResetPassword: pulumi.Bool(false),
SkipConfirmation: pulumi.Bool(false),
State: pulumi.String("string"),
ExternUid: pulumi.String("string"),
})
var userResource = new User("userResource", UserArgs.builder()
.username("string")
.email("string")
.name("string")
.externalProvider("string")
.isAdmin(false)
.isExternal(false)
.canCreateGroup(false)
.namespaceId(0)
.note("string")
.password("string")
.projectsLimit(0)
.resetPassword(false)
.skipConfirmation(false)
.state("string")
.externUid("string")
.build());
user_resource = gitlab.User("userResource",
username="string",
email="string",
name="string",
external_provider="string",
is_admin=False,
is_external=False,
can_create_group=False,
namespace_id=0,
note="string",
password="string",
projects_limit=0,
reset_password=False,
skip_confirmation=False,
state="string",
extern_uid="string")
const userResource = new gitlab.User("userResource", {
username: "string",
email: "string",
name: "string",
externalProvider: "string",
isAdmin: false,
isExternal: false,
canCreateGroup: false,
namespaceId: 0,
note: "string",
password: "string",
projectsLimit: 0,
resetPassword: false,
skipConfirmation: false,
state: "string",
externUid: "string",
});
type: gitlab:User
properties:
canCreateGroup: false
email: string
externUid: string
externalProvider: string
isAdmin: false
isExternal: false
name: string
namespaceId: 0
note: string
password: string
projectsLimit: 0
resetPassword: false
skipConfirmation: false
state: string
username: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The User resource accepts the following input properties:
- Email string
- The e-mail address of the user.
- Username string
- The username of the user.
- Can
Create boolGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- Extern
Uid string - String, a specific external authentication provider UID.
- External
Provider string - String, the external provider.
- 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 string
- The name of the user.
- Namespace
Id 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.
- 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 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.
- Can
Create boolGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- Extern
Uid string - String, a specific external authentication provider UID.
- External
Provider string - String, the external provider.
- 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 string
- The name of the user.
- Namespace
Id 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.
- 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 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.
- can
Create BooleanGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- extern
Uid String - String, a specific external authentication provider UID.
- external
Provider String - String, the external provider.
- is
Admin Boolean - Boolean, defaults to false. Whether to enable administrative privileges
- is
External 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.
- namespace
Id 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.
- projects
Limit Integer - Integer, defaults to 0. Number of projects user can create.
- reset
Password Boolean - Boolean, defaults to false. Send user password reset link.
- skip
Confirmation 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.
- can
Create booleanGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- extern
Uid string - String, a specific external authentication provider UID.
- external
Provider string - String, the external provider.
- is
Admin boolean - Boolean, defaults to false. Whether to enable administrative privileges
- is
External 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.
- namespace
Id 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.
- projects
Limit number - Integer, defaults to 0. Number of projects user can create.
- reset
Password boolean - Boolean, defaults to false. Send user password reset link.
- skip
Confirmation 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_ boolgroup - Boolean, defaults to false. Whether to allow the user to create groups.
- extern_
uid str - String, a specific external authentication provider UID.
- external_
provider str - String, the external provider.
- 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.
- can
Create BooleanGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- extern
Uid String - String, a specific external authentication provider UID.
- external
Provider String - String, the external provider.
- is
Admin Boolean - Boolean, defaults to false. Whether to enable administrative privileges
- is
External 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.
- namespace
Id 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.
- projects
Limit Number - Integer, defaults to 0. Number of projects user can create.
- reset
Password Boolean - Boolean, defaults to false. Send user password reset link.
- skip
Confirmation 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,
extern_uid: Optional[str] = None,
external_provider: 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.
- Can
Create boolGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- Email string
- The e-mail address of the user.
- Extern
Uid string - String, a specific external authentication provider UID.
- External
Provider string - String, the external provider.
- 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 string
- The name of the user.
- Namespace
Id 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.
- 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 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 boolGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- Email string
- The e-mail address of the user.
- Extern
Uid string - String, a specific external authentication provider UID.
- External
Provider string - String, the external provider.
- 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 string
- The name of the user.
- Namespace
Id 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.
- 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 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 BooleanGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- email String
- The e-mail address of the user.
- extern
Uid String - String, a specific external authentication provider UID.
- external
Provider String - String, the external provider.
- is
Admin Boolean - Boolean, defaults to false. Whether to enable administrative privileges
- is
External 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.
- namespace
Id 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.
- projects
Limit Integer - Integer, defaults to 0. Number of projects user can create.
- reset
Password Boolean - Boolean, defaults to false. Send user password reset link.
- skip
Confirmation 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 booleanGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- email string
- The e-mail address of the user.
- extern
Uid string - String, a specific external authentication provider UID.
- external
Provider string - String, the external provider.
- is
Admin boolean - Boolean, defaults to false. Whether to enable administrative privileges
- is
External 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.
- namespace
Id 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.
- projects
Limit number - Integer, defaults to 0. Number of projects user can create.
- reset
Password boolean - Boolean, defaults to false. Send user password reset link.
- skip
Confirmation 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_ boolgroup - Boolean, defaults to false. Whether to allow the user to create groups.
- email str
- The e-mail address of the user.
- extern_
uid str - String, a specific external authentication provider UID.
- external_
provider str - String, the external provider.
- 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.
- can
Create BooleanGroup - Boolean, defaults to false. Whether to allow the user to create groups.
- email String
- The e-mail address of the user.
- extern
Uid String - String, a specific external authentication provider UID.
- external
Provider String - String, the external provider.
- is
Admin Boolean - Boolean, defaults to false. Whether to enable administrative privileges
- is
External 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.
- namespace
Id 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.
- projects
Limit Number - Integer, defaults to 0. Number of projects user can create.
- reset
Password Boolean - Boolean, defaults to false. Send user password reset link.
- skip
Confirmation 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlab
Terraform Provider.