gitlab.DeployToken
Explore with Pulumi AI
The gitlab.DeployToken
resource allows to manage the lifecycle of group and project deploy tokens.
Upstream API: GitLab REST API docs
Create DeployToken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DeployToken(name: string, args: DeployTokenArgs, opts?: CustomResourceOptions);
@overload
def DeployToken(resource_name: str,
args: DeployTokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DeployToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
scopes: Optional[Sequence[str]] = None,
expires_at: Optional[str] = None,
group: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
username: Optional[str] = None)
func NewDeployToken(ctx *Context, name string, args DeployTokenArgs, opts ...ResourceOption) (*DeployToken, error)
public DeployToken(string name, DeployTokenArgs args, CustomResourceOptions? opts = null)
public DeployToken(String name, DeployTokenArgs args)
public DeployToken(String name, DeployTokenArgs args, CustomResourceOptions options)
type: gitlab:DeployToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name
This property is required. string - The unique name of the resource.
- args
This property is required. DeployTokenArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
This property is required. str - The unique name of the resource.
- args
This property is required. DeployTokenArgs - The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. DeployTokenArgs - The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. DeployTokenArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name
This property is required. String - The unique name of the resource.
- args
This property is required. DeployTokenArgs - The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var deployTokenResource = new GitLab.DeployToken("deployTokenResource", new()
{
Scopes = new[]
{
"string",
},
ExpiresAt = "string",
Group = "string",
Name = "string",
Project = "string",
Username = "string",
});
example, err := gitlab.NewDeployToken(ctx, "deployTokenResource", &gitlab.DeployTokenArgs{
Scopes: pulumi.StringArray{
pulumi.String("string"),
},
ExpiresAt: pulumi.String("string"),
Group: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
Username: pulumi.String("string"),
})
var deployTokenResource = new DeployToken("deployTokenResource", DeployTokenArgs.builder()
.scopes("string")
.expiresAt("string")
.group("string")
.name("string")
.project("string")
.username("string")
.build());
deploy_token_resource = gitlab.DeployToken("deployTokenResource",
scopes=["string"],
expires_at="string",
group="string",
name="string",
project="string",
username="string")
const deployTokenResource = new gitlab.DeployToken("deployTokenResource", {
scopes: ["string"],
expiresAt: "string",
group: "string",
name: "string",
project: "string",
username: "string",
});
type: gitlab:DeployToken
properties:
expiresAt: string
group: string
name: string
project: string
scopes:
- string
username: string
DeployToken Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DeployToken resource accepts the following input properties:
- Scopes
This property is required. Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - Expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- Group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- Name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- Project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- Username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- Scopes
This property is required. Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - Expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- Group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- Name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- Project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- Username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- scopes
This property is required. Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- scopes
This property is required. Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- scopes
This property is required. Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - expires_
at Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- scopes
This property is required. Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- username
Changes to this property will trigger replacement.
- 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:
- Deploy
Token intId - The id of the 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. Note: The token is not available for imported resources.
- Deploy
Token intId - The id of the 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. Note: The token is not available for imported resources.
- deploy
Token IntegerId - The id of the 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. Note: The token is not available for imported resources.
- deploy
Token numberId - The id of the 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. Note: The token is not available for imported resources.
- deploy_
token_ intid - The id of the 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. Note: The token is not available for imported resources.
- deploy
Token NumberId - The id of the 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. Note: The token is not available for imported resources.
Look up 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
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
deploy_token_id: Optional[int] = None,
expires_at: Optional[str] = None,
group: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
token: Optional[str] = None,
username: Optional[str] = None) -> DeployToken
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)
public static DeployToken get(String name, Output<String> id, DeployTokenState state, CustomResourceOptions options)
resources: _: type: gitlab:DeployToken get: id: ${id}
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - The unique provider ID of the resource to lookup.
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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.
- Deploy
Token intId - The id of the deploy token.
- Expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- Group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- Name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- Project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- Scopes
Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - Token string
- The secret token. This is only populated when creating a new deploy token. Note: The token is not available for imported resources.
- Username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- Deploy
Token intId - The id of the deploy token.
- Expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- Group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- Name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- Project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- Scopes
Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - Token string
- The secret token. This is only populated when creating a new deploy token. Note: The token is not available for imported resources.
- Username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- deploy
Token IntegerId - The id of the deploy token.
- expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- scopes
Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - token String
- The secret token. This is only populated when creating a new deploy token. Note: The token is not available for imported resources.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- deploy
Token numberId - The id of the deploy token.
- expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- scopes
Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - token string
- The secret token. This is only populated when creating a new deploy token. Note: The token is not available for imported resources.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- deploy_
token_ intid - The id of the deploy token.
- expires_
at Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- scopes
Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - token str
- The secret token. This is only populated when creating a new deploy token. Note: The token is not available for imported resources.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
- deploy
Token NumberId - The id of the deploy token.
- expires
At Changes to this property will trigger replacement.
- Time the token will expire it, RFC3339 format. Will not expire per default.
- group
Changes to this property will trigger replacement.
- The name or id of the group to add the deploy token to.
- name
Changes to this property will trigger replacement.
- A name to describe the deploy token with.
- project
Changes to this property will trigger replacement.
- The name or id of the project to add the deploy token to.
- scopes
Changes to this property will trigger replacement.
- Valid values:
read_repository
,read_registry
,read_package_registry
,write_registry
,write_package_registry
. - token String
- The secret token. This is only populated when creating a new deploy token. Note: The token is not available for imported resources.
- username
Changes to this property will trigger replacement.
- A username for the deploy token. Default is
gitlab+deploy-token-{n}
.
Import
Starting in Terraform v1.5.0 you can use an import block to import gitlab_deploy_token
. For example:
terraform
import {
to = gitlab_deploy_token.example
id = “see CLI command below for ID”
}
Import using the CLI is supported using the following syntax:
GitLab deploy tokens can be imported using an id made up of {type}:{type_id}:{deploy_token_id}
, where type is one of: project, group.
$ pulumi import gitlab:index/deployToken:DeployToken group_token group:1:3
$ pulumi import gitlab:index/deployToken:DeployToken project_token project:1:4
Note: the token
resource attribute is not available for imported resources as this information cannot be read from the GitLab API.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlab
Terraform Provider.