DeployToken

This resource allows you to create and manage deploy token for your GitLab projects and groups.

Example Usage - Project

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = new gitlab.DeployToken("example", {
    expiresAt: "2020-03-14T00:00:00.000Z",
    project: "example/deploying",
    scopes: [
        "read_repository",
        "read_registry",
    ],
    username: "example-username",
});
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.DeployToken("example",
    expires_at="2020-03-14T00:00:00.000Z",
    project="example/deploying",
    scopes=[
        "read_repository",
        "read_registry",
    ],
    username="example-username")
using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new GitLab.DeployToken("example", new GitLab.DeployTokenArgs
        {
            ExpiresAt = "2020-03-14T00:00:00.000Z",
            Project = "example/deploying",
            Scopes = 
            {
                "read_repository",
                "read_registry",
            },
            Username = "example-username",
        });
    }

}

Example Usage - Group

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = new gitlab.DeployToken("example", {
    group: "example/deploying",
    scopes: ["read_repository"],
});
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.DeployToken("example",
    group="example/deploying",
    scopes=["read_repository"])
using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new GitLab.DeployToken("example", new GitLab.DeployTokenArgs
        {
            Group = "example/deploying",
            Scopes = 
            {
                "read_repository",
            },
        });
    }

}

Create a DeployToken Resource

def DeployToken(resource_name, opts=None, expires_at=None, group=None, name=None, project=None, scopes=None, username=None, __props__=None);
func NewDeployToken(ctx *Context, name string, args DeployTokenArgs, opts ...ResourceOption) (*DeployToken, error)
public DeployToken(string name, DeployTokenArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DeployTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DeployTokenArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DeployTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

DeployToken Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The DeployToken resource accepts the following input properties:

Scopes List<string>

Valid values: read_repository, read_registry.

ExpiresAt string
Group string

The name or id of the group to add the deploy token to. Either project or group must be set.

Name string

A name to describe the deploy token with.

Project string

The name or id of the project to add the deploy token to. Either project or group must be set.

Username string

A username for the deploy token. Default is gitlab+deploy-token-{n}.

Scopes []string

Valid values: read_repository, read_registry.

ExpiresAt string
Group string

The name or id of the group to add the deploy token to. Either project or group must be set.

Name string

A name to describe the deploy token with.

Project string

The name or id of the project to add the deploy token to. Either project or group must be set.

Username string

A username for the deploy token. Default is gitlab+deploy-token-{n}.

scopes string[]

Valid values: read_repository, read_registry.

expiresAt string
group string

The name or id of the group to add the deploy token to. Either project or group must be set.

name string

A name to describe the deploy token with.

project string

The name or id of the project to add the deploy token to. Either project or group must be set.

username string

A username for the deploy token. Default is gitlab+deploy-token-{n}.

scopes List[str]

Valid values: read_repository, read_registry.

expires_at str
group str

The name or id of the group to add the deploy token to. Either project or group must be set.

name str

A name to describe the deploy token with.

project str

The name or id of the project to add the deploy token to. Either project or group must be set.

username str

A username for the deploy token. Default is gitlab+deploy-token-{n}.

Outputs

All input properties are implicitly available as output properties. Additionally, the DeployToken resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Token string

The secret token. This is only populated when creating a new deploy token.

Id string
The provider-assigned unique ID for this managed resource.
Token string

The secret token. This is only populated when creating a new deploy token.

id string
The provider-assigned unique ID for this managed resource.
token string

The secret token. This is only populated when creating a new deploy token.

id str
The provider-assigned unique ID for this managed resource.
token str

The secret token. This is only populated when creating a new deploy token.

Look up an Existing DeployToken Resource

Get an existing DeployToken resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DeployTokenState, opts?: CustomResourceOptions): DeployToken
static get(resource_name, id, opts=None, expires_at=None, group=None, name=None, project=None, scopes=None, token=None, username=None, __props__=None);
func GetDeployToken(ctx *Context, name string, id IDInput, state *DeployTokenState, opts ...ResourceOption) (*DeployToken, error)
public static DeployToken Get(string name, Input<string> id, DeployTokenState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ExpiresAt string
Group string

The name or id of the group to add the deploy token to. Either project or group must be set.

Name string

A name to describe the deploy token with.

Project string

The name or id of the project to add the deploy token to. Either project or group must be set.

Scopes List<string>

Valid values: read_repository, read_registry.

Token string

The secret token. This is only populated when creating a new deploy token.

Username string

A username for the deploy token. Default is gitlab+deploy-token-{n}.

ExpiresAt string
Group string

The name or id of the group to add the deploy token to. Either project or group must be set.

Name string

A name to describe the deploy token with.

Project string

The name or id of the project to add the deploy token to. Either project or group must be set.

Scopes []string

Valid values: read_repository, read_registry.

Token string

The secret token. This is only populated when creating a new deploy token.

Username string

A username for the deploy token. Default is gitlab+deploy-token-{n}.

expiresAt string
group string

The name or id of the group to add the deploy token to. Either project or group must be set.

name string

A name to describe the deploy token with.

project string

The name or id of the project to add the deploy token to. Either project or group must be set.

scopes string[]

Valid values: read_repository, read_registry.

token string

The secret token. This is only populated when creating a new deploy token.

username string

A username for the deploy token. Default is gitlab+deploy-token-{n}.

expires_at str
group str

The name or id of the group to add the deploy token to. Either project or group must be set.

name str

A name to describe the deploy token with.

project str

The name or id of the project to add the deploy token to. Either project or group must be set.

scopes List[str]

Valid values: read_repository, read_registry.

token str

The secret token. This is only populated when creating a new deploy token.

username str

A username for the deploy token. Default is gitlab+deploy-token-{n}.

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.