GroupAccessTokenArgs

data class GroupAccessTokenArgs(val accessLevel: Output<String>? = null, val expiresAt: Output<String>? = null, val group: Output<String>? = null, val name: Output<String>? = null, val rotationConfiguration: Output<GroupAccessTokenRotationConfigurationArgs>? = null, val scopes: Output<List<String>>? = null) : ConvertibleToJava<GroupAccessTokenArgs>

The gitlab.GroupAccessTokenresource allows to manage the lifecycle of a group access token.

Observability scopes are in beta and may not work on all instances. See more details in the documentation Use rotation_configuration to automatically rotate tokens instead of using timestamp() as timestamp will cause changes with every plan. pulumi up must still be run to rotate the token. Due to Automatic reuse detection it's possible that a new Group Access Token will immediately be revoked. Check if an old process using the old token is running if this happens. Upstream API: GitLab REST API

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const exampleGroupAccessToken = new gitlab.GroupAccessToken("exampleGroupAccessToken", {
group: "25",
expiresAt: "2020-03-14",
accessLevel: "developer",
scopes: ["api"],
});
const exampleGroupVariable = new gitlab.GroupVariable("exampleGroupVariable", {
group: "25",
key: "gat",
value: exampleGroupAccessToken.token,
});
import pulumi
import pulumi_gitlab as gitlab
example_group_access_token = gitlab.GroupAccessToken("exampleGroupAccessToken",
group="25",
expires_at="2020-03-14",
access_level="developer",
scopes=["api"])
example_group_variable = gitlab.GroupVariable("exampleGroupVariable",
group="25",
key="gat",
value=example_group_access_token.token)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var exampleGroupAccessToken = new GitLab.GroupAccessToken("exampleGroupAccessToken", new()
{
Group = "25",
ExpiresAt = "2020-03-14",
AccessLevel = "developer",
Scopes = new[]
{
"api",
},
});
var exampleGroupVariable = new GitLab.GroupVariable("exampleGroupVariable", new()
{
Group = "25",
Key = "gat",
Value = exampleGroupAccessToken.Token,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleGroupAccessToken, err := gitlab.NewGroupAccessToken(ctx, "exampleGroupAccessToken", &gitlab.GroupAccessTokenArgs{
Group: pulumi.String("25"),
ExpiresAt: pulumi.String("2020-03-14"),
AccessLevel: pulumi.String("developer"),
Scopes: pulumi.StringArray{
pulumi.String("api"),
},
})
if err != nil {
return err
}
_, err = gitlab.NewGroupVariable(ctx, "exampleGroupVariable", &gitlab.GroupVariableArgs{
Group: pulumi.String("25"),
Key: pulumi.String("gat"),
Value: exampleGroupAccessToken.Token,
})
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.GroupAccessToken;
import com.pulumi.gitlab.GroupAccessTokenArgs;
import com.pulumi.gitlab.GroupVariable;
import com.pulumi.gitlab.GroupVariableArgs;
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 exampleGroupAccessToken = new GroupAccessToken("exampleGroupAccessToken", GroupAccessTokenArgs.builder()
.group("25")
.expiresAt("2020-03-14")
.accessLevel("developer")
.scopes("api")
.build());
var exampleGroupVariable = new GroupVariable("exampleGroupVariable", GroupVariableArgs.builder()
.group("25")
.key("gat")
.value(exampleGroupAccessToken.token())
.build());
}
}
resources:
exampleGroupAccessToken:
type: gitlab:GroupAccessToken
properties:
group: '25'
expiresAt: 2020-03-14
accessLevel: developer
scopes:
- api
exampleGroupVariable:
type: gitlab:GroupVariable
properties:
group: '25'
key: gat
value: ${exampleGroupAccessToken.token}

Import

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

$ pulumi import gitlab:index/groupAccessToken:GroupAccessToken example "12345:1"

ATTENTION: the 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, group: Output<String>? = null, name: Output<String>? = null, rotationConfiguration: Output<GroupAccessTokenRotationConfigurationArgs>? = null, scopes: Output<List<String>>? = null)

Properties

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

The access level for the group 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

When the token will expire, YYYY-MM-DD format.

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

The ID or full path of the group.

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

The name of the group access token.

Link copied to clipboard

The configuration for when to rotate a token automatically. Will not rotate a token until pulumi up is run.

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

The scopes of the group access token. Valid values are: api, read_api, read_user, k8s_proxy, read_registry, write_registry, read_repository, write_repository, create_runner, ai_features, k8s_proxy, read_observability, write_observability

Functions

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