UserIdentityArgs

data class UserIdentityArgs(val externalProvider: Output<String>? = null, val externalUid: Output<String>? = null, val userId: Output<Int>? = null) : ConvertibleToJava<UserIdentityArgs>

The gitlab.UserIdentity resource is for managing the lifecycle of a user's external identity.

the provider needs to be configured with admin-level access for this resource to work. 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",
email: "gitlab@user.create",
isAdmin: true,
projectsLimit: 4,
canCreateGroup: false,
isExternal: true,
});
const exampleUserIdentity = new gitlab.UserIdentity("example", {
userId: example.id,
externalProvider: "google",
externalUid: "1234567890",
});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.User("example",
name="Example Foo",
username="example",
email="gitlab@user.create",
is_admin=True,
projects_limit=4,
can_create_group=False,
is_external=True)
example_user_identity = gitlab.UserIdentity("example",
user_id=example.id,
external_provider="google",
external_uid="1234567890")
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",
Email = "gitlab@user.create",
IsAdmin = true,
ProjectsLimit = 4,
CanCreateGroup = false,
IsExternal = true,
});
var exampleUserIdentity = new GitLab.UserIdentity("example", new()
{
UserId = example.Id,
ExternalProvider = "google",
ExternalUid = "1234567890",
});
});
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 {
example, err := gitlab.NewUser(ctx, "example", &gitlab.UserArgs{
Name: pulumi.String("Example Foo"),
Username: pulumi.String("example"),
Email: pulumi.String("gitlab@user.create"),
IsAdmin: pulumi.Bool(true),
ProjectsLimit: pulumi.Int(4),
CanCreateGroup: pulumi.Bool(false),
IsExternal: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = gitlab.NewUserIdentity(ctx, "example", &gitlab.UserIdentityArgs{
UserId: example.ID(),
ExternalProvider: pulumi.String("google"),
ExternalUid: pulumi.String("1234567890"),
})
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 com.pulumi.gitlab.UserIdentity;
import com.pulumi.gitlab.UserIdentityArgs;
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")
.email("gitlab@user.create")
.isAdmin(true)
.projectsLimit(4)
.canCreateGroup(false)
.isExternal(true)
.build());
var exampleUserIdentity = new UserIdentity("exampleUserIdentity", UserIdentityArgs.builder()
.userId(example.id())
.externalProvider("google")
.externalUid("1234567890")
.build());
}
}
resources:
example:
type: gitlab:User
properties:
name: Example Foo
username: example
email: gitlab@user.create
isAdmin: true
projectsLimit: 4
canCreateGroup: false
isExternal: true
exampleUserIdentity:
type: gitlab:UserIdentity
name: example
properties:
userId: ${example.id}
externalProvider: google
externalUid: '1234567890'

Import

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

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

The id must be a string for the id of the user and identity provider you want to import, for example:

$ pulumi import gitlab:index/userIdentity:UserIdentity example "42:google"

Constructors

Link copied to clipboard
constructor(externalProvider: Output<String>? = null, externalUid: Output<String>? = null, userId: Output<Int>? = null)

Properties

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

The external provider name.

Link copied to clipboard
val externalUid: Output<String>? = null

A specific external authentication provider UID.

Link copied to clipboard
val userId: Output<Int>? = null

The GitLab ID of the user.

Functions

Link copied to clipboard
open override fun toJava(): UserIdentityArgs