PersonalAccessTokenArgs

data class PersonalAccessTokenArgs(val expiresAt: Output<String>? = null, val name: Output<String>? = null, val scopes: Output<List<String>>? = null, val userId: Output<Int>? = null) : ConvertibleToJava<PersonalAccessTokenArgs>

The gitlab.PersonalAccessToken resource allows to manage the lifecycle of a personal access token for a specified user.

This resource requires administration privileges. Upstream API: GitLab REST API docs

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.PersonalAccessToken;
import com.pulumi.gitlab.PersonalAccessTokenArgs;
import com.pulumi.gitlab.ProjectVariable;
import com.pulumi.gitlab.ProjectVariableArgs;
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 examplePersonalAccessToken = new PersonalAccessToken("examplePersonalAccessToken", PersonalAccessTokenArgs.builder()
.userId("25")
.expiresAt("2020-03-14")
.scopes("api")
.build());
var exampleProjectVariable = new ProjectVariable("exampleProjectVariable", ProjectVariableArgs.builder()
.project(gitlab_project.example().id())
.key("pat")
.value(examplePersonalAccessToken.token())
.build());
}
}

Import

A GitLab Personal Access Token can be imported using a key composed of <user-id>:<token-id>, e.g.

$ pulumi import gitlab:index/personalAccessToken:PersonalAccessToken example "12345:1"

NOTEthe token resource attribute is not available for imported resources as this information cannot be read from the GitLab API.

Constructors

Link copied to clipboard
constructor(expiresAt: Output<String>? = null, name: Output<String>? = null, scopes: Output<List<String>>? = null, userId: Output<Int>? = null)

Properties

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

The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD. Default is never.

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

The name of the personal access token.

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

The scope for the personal access token. It determines the actions which can be performed when authenticating with this token. Valid values are: api, read_user, read_api, read_repository, write_repository, read_registry, write_registry, sudo.

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

The id of the user.

Functions

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