gitlab.ClusterAgentToken

Explore with Pulumi AI

The gitlab.ClusterAgentToken resource allows to manage the lifecycle of a token for a GitLab Agent for Kubernetes.

Requires at least maintainer permissions on the project.

Requires at least GitLab 15.0

Upstream API: GitLab REST API docs

Create ClusterAgentToken Resource

new ClusterAgentToken(name: string, args: ClusterAgentTokenArgs, opts?: CustomResourceOptions);
@overload
def ClusterAgentToken(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      agent_id: Optional[int] = None,
                      description: Optional[str] = None,
                      name: Optional[str] = None,
                      project: Optional[str] = None)
@overload
def ClusterAgentToken(resource_name: str,
                      args: ClusterAgentTokenArgs,
                      opts: Optional[ResourceOptions] = None)
func NewClusterAgentToken(ctx *Context, name string, args ClusterAgentTokenArgs, opts ...ResourceOption) (*ClusterAgentToken, error)
public ClusterAgentToken(string name, ClusterAgentTokenArgs args, CustomResourceOptions? opts = null)
public ClusterAgentToken(String name, ClusterAgentTokenArgs args)
public ClusterAgentToken(String name, ClusterAgentTokenArgs args, CustomResourceOptions options)
type: gitlab:ClusterAgentToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ClusterAgentTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ClusterAgentTokenArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ClusterAgentTokenArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ClusterAgentTokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ClusterAgentTokenArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ClusterAgentToken Resource Properties

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

Inputs

The ClusterAgentToken resource accepts the following input properties:

AgentId int

The ID of the agent.

Project string

ID or full path of the project maintained by the authenticated user.

Description string

The Description for the agent.

Name string

The Name of the agent.

AgentId int

The ID of the agent.

Project string

ID or full path of the project maintained by the authenticated user.

Description string

The Description for the agent.

Name string

The Name of the agent.

agentId Integer

The ID of the agent.

project String

ID or full path of the project maintained by the authenticated user.

description String

The Description for the agent.

name String

The Name of the agent.

agentId number

The ID of the agent.

project string

ID or full path of the project maintained by the authenticated user.

description string

The Description for the agent.

name string

The Name of the agent.

agent_id int

The ID of the agent.

project str

ID or full path of the project maintained by the authenticated user.

description str

The Description for the agent.

name str

The Name of the agent.

agentId Number

The ID of the agent.

project String

ID or full path of the project maintained by the authenticated user.

description String

The Description for the agent.

name String

The Name of the agent.

Outputs

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

CreatedAt string

The ISO8601 datetime when the agent was created.

CreatedByUserId int

The ID of the user who created the agent.

Id string

The provider-assigned unique ID for this managed resource.

LastUsedAt string

The ISO8601 datetime when the token was last used.

Status string

The status of the token. Valid values are active, revoked.

Token string

The secret token for the agent. The token is not available in imported resources.

TokenId int

The ID of the token.

CreatedAt string

The ISO8601 datetime when the agent was created.

CreatedByUserId int

The ID of the user who created the agent.

Id string

The provider-assigned unique ID for this managed resource.

LastUsedAt string

The ISO8601 datetime when the token was last used.

Status string

The status of the token. Valid values are active, revoked.

Token string

The secret token for the agent. The token is not available in imported resources.

TokenId int

The ID of the token.

createdAt String

The ISO8601 datetime when the agent was created.

createdByUserId Integer

The ID of the user who created the agent.

id String

The provider-assigned unique ID for this managed resource.

lastUsedAt String

The ISO8601 datetime when the token was last used.

status String

The status of the token. Valid values are active, revoked.

token String

The secret token for the agent. The token is not available in imported resources.

tokenId Integer

The ID of the token.

createdAt string

The ISO8601 datetime when the agent was created.

createdByUserId number

The ID of the user who created the agent.

id string

The provider-assigned unique ID for this managed resource.

lastUsedAt string

The ISO8601 datetime when the token was last used.

status string

The status of the token. Valid values are active, revoked.

token string

The secret token for the agent. The token is not available in imported resources.

tokenId number

The ID of the token.

created_at str

The ISO8601 datetime when the agent was created.

created_by_user_id int

The ID of the user who created the agent.

id str

The provider-assigned unique ID for this managed resource.

last_used_at str

The ISO8601 datetime when the token was last used.

status str

The status of the token. Valid values are active, revoked.

token str

The secret token for the agent. The token is not available in imported resources.

token_id int

The ID of the token.

createdAt String

The ISO8601 datetime when the agent was created.

createdByUserId Number

The ID of the user who created the agent.

id String

The provider-assigned unique ID for this managed resource.

lastUsedAt String

The ISO8601 datetime when the token was last used.

status String

The status of the token. Valid values are active, revoked.

token String

The secret token for the agent. The token is not available in imported resources.

tokenId Number

The ID of the token.

Look up Existing ClusterAgentToken Resource

Get an existing ClusterAgentToken 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?: ClusterAgentTokenState, opts?: CustomResourceOptions): ClusterAgentToken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        agent_id: Optional[int] = None,
        created_at: Optional[str] = None,
        created_by_user_id: Optional[int] = None,
        description: Optional[str] = None,
        last_used_at: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        status: Optional[str] = None,
        token: Optional[str] = None,
        token_id: Optional[int] = None) -> ClusterAgentToken
func GetClusterAgentToken(ctx *Context, name string, id IDInput, state *ClusterAgentTokenState, opts ...ResourceOption) (*ClusterAgentToken, error)
public static ClusterAgentToken Get(string name, Input<string> id, ClusterAgentTokenState? state, CustomResourceOptions? opts = null)
public static ClusterAgentToken get(String name, Output<String> id, ClusterAgentTokenState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
AgentId int

The ID of the agent.

CreatedAt string

The ISO8601 datetime when the agent was created.

CreatedByUserId int

The ID of the user who created the agent.

Description string

The Description for the agent.

LastUsedAt string

The ISO8601 datetime when the token was last used.

Name string

The Name of the agent.

Project string

ID or full path of the project maintained by the authenticated user.

Status string

The status of the token. Valid values are active, revoked.

Token string

The secret token for the agent. The token is not available in imported resources.

TokenId int

The ID of the token.

AgentId int

The ID of the agent.

CreatedAt string

The ISO8601 datetime when the agent was created.

CreatedByUserId int

The ID of the user who created the agent.

Description string

The Description for the agent.

LastUsedAt string

The ISO8601 datetime when the token was last used.

Name string

The Name of the agent.

Project string

ID or full path of the project maintained by the authenticated user.

Status string

The status of the token. Valid values are active, revoked.

Token string

The secret token for the agent. The token is not available in imported resources.

TokenId int

The ID of the token.

agentId Integer

The ID of the agent.

createdAt String

The ISO8601 datetime when the agent was created.

createdByUserId Integer

The ID of the user who created the agent.

description String

The Description for the agent.

lastUsedAt String

The ISO8601 datetime when the token was last used.

name String

The Name of the agent.

project String

ID or full path of the project maintained by the authenticated user.

status String

The status of the token. Valid values are active, revoked.

token String

The secret token for the agent. The token is not available in imported resources.

tokenId Integer

The ID of the token.

agentId number

The ID of the agent.

createdAt string

The ISO8601 datetime when the agent was created.

createdByUserId number

The ID of the user who created the agent.

description string

The Description for the agent.

lastUsedAt string

The ISO8601 datetime when the token was last used.

name string

The Name of the agent.

project string

ID or full path of the project maintained by the authenticated user.

status string

The status of the token. Valid values are active, revoked.

token string

The secret token for the agent. The token is not available in imported resources.

tokenId number

The ID of the token.

agent_id int

The ID of the agent.

created_at str

The ISO8601 datetime when the agent was created.

created_by_user_id int

The ID of the user who created the agent.

description str

The Description for the agent.

last_used_at str

The ISO8601 datetime when the token was last used.

name str

The Name of the agent.

project str

ID or full path of the project maintained by the authenticated user.

status str

The status of the token. Valid values are active, revoked.

token str

The secret token for the agent. The token is not available in imported resources.

token_id int

The ID of the token.

agentId Number

The ID of the agent.

createdAt String

The ISO8601 datetime when the agent was created.

createdByUserId Number

The ID of the user who created the agent.

description String

The Description for the agent.

lastUsedAt String

The ISO8601 datetime when the token was last used.

name String

The Name of the agent.

project String

ID or full path of the project maintained by the authenticated user.

status String

The status of the token. Valid values are active, revoked.

token String

The secret token for the agent. The token is not available in imported resources.

tokenId Number

The ID of the token.

Import

A token for a GitLab Agent for Kubernetes can be imported with the following command and the id pattern <project>:<agent-id>:<token-id>

 $ pulumi import gitlab:index/clusterAgentToken:ClusterAgentToken example '12345:42:1'

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

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes

This Pulumi package is based on the gitlab Terraform Provider.