ProjectAccessTokenArgs

data class ProjectAccessTokenArgs(val accessLevel: Output<String>? = null, val expiresAt: Output<String>? = null, val name: Output<String>? = null, val project: Output<String>? = null, val scopes: Output<List<String>>? = null) : ConvertibleToJava<ProjectAccessTokenArgs>

The gitlab.ProjectAccessToken resource allows to manage the lifecycle of a project access token. Upstream API: GitLab API docs

Example Usage

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

Import

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

$ pulumi import gitlab:index/projectAccessToken:ProjectAccessToken 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(accessLevel: Output<String>? = null, expiresAt: Output<String>? = null, name: Output<String>? = null, project: Output<String>? = null, scopes: Output<List<String>>? = null)

Properties

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

The access level for the project access token. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner, master. Default is maintainer.

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

Time the token will expire it, YYYY-MM-DD format. Will not expire per default.

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

A name to describe the project access token.

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

The id of the project to add the project access token to.

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

Valid values: api, read_api, read_repository, write_repository, read_registry, write_registry.

Functions

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