User Impersonation Token Args
data class UserImpersonationTokenArgs(val expiresAt: Output<String>? = null, val name: Output<String>? = null, val scopes: Output<List<String>>? = null, val userId: Output<Int>? = null) : ConvertibleToJava<UserImpersonationTokenArgs>
The gitlab.UserImpersonationToken resource allows to manage impersonation tokens of users. Requires administrator access. Token values are returned once. You are only able to create impersonation tokens to impersonate the user and perform both API calls and Git reads and writes. The user can’t see these tokens in their profile settings page. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const _this = new gitlab.UserImpersonationToken("this", {
userId: 12345,
name: "token_name",
scopes: ["api"],
expiresAt: "2024-08-27",
});Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
this = gitlab.UserImpersonationToken("this",
user_id=12345,
name="token_name",
scopes=["api"],
expires_at="2024-08-27")Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var @this = new GitLab.UserImpersonationToken("this", new()
{
UserId = 12345,
Name = "token_name",
Scopes = new[]
{
"api",
},
ExpiresAt = "2024-08-27",
});
});Content copied to clipboard
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.NewUserImpersonationToken(ctx, "this", &gitlab.UserImpersonationTokenArgs{
UserId: pulumi.Int(12345),
Name: pulumi.String("token_name"),
Scopes: pulumi.StringArray{
pulumi.String("api"),
},
ExpiresAt: pulumi.String("2024-08-27"),
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.UserImpersonationToken;
import com.pulumi.gitlab.UserImpersonationTokenArgs;
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 this_ = new UserImpersonationToken("this", UserImpersonationTokenArgs.builder()
.userId(12345)
.name("token_name")
.scopes("api")
.expiresAt("2024-08-27")
.build());
}
}Content copied to clipboard
resources:
this:
type: gitlab:UserImpersonationToken
properties:
userId: 12345
name: token_name
scopes:
- api
expiresAt: 2024-08-27Content copied to clipboard
Import
A GitLab User Impersonation Token can be imported using a key composed of <user-id>:<token-id>, e.g.
$ pulumi import gitlab:index/userImpersonationToken:UserImpersonationToken example "12345:1"Content copied to clipboard
NOTE: the token resource attribute is not available for imported resources as this information cannot be read from the GitLab API.