1. Packages
  2. Zitadel
  3. API Docs
  4. PersonalAccessToken
zitadel v0.2.0 published on Monday, Mar 24, 2025 by pulumiverse

zitadel.PersonalAccessToken

Explore with Pulumi AI

Resource representing a personal access token of a user

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Zitadel = Pulumiverse.Zitadel;

return await Deployment.RunAsync(() => 
{
    var @default = new Zitadel.PersonalAccessToken("default", new()
    {
        OrgId = defaultZitadelOrg.Id,
        UserId = defaultZitadelMachineUser.Id,
        ExpirationDate = "2519-04-01T08:45:00Z",
    });

});
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := zitadel.NewPersonalAccessToken(ctx, "default", &zitadel.PersonalAccessTokenArgs{
			OrgId:          pulumi.Any(defaultZitadelOrg.Id),
			UserId:         pulumi.Any(defaultZitadelMachineUser.Id),
			ExpirationDate: pulumi.String("2519-04-01T08:45:00Z"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zitadel.PersonalAccessToken;
import com.pulumi.zitadel.PersonalAccessTokenArgs;
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 default_ = new PersonalAccessToken("default", PersonalAccessTokenArgs.builder()        
            .orgId(defaultZitadelOrg.id())
            .userId(defaultZitadelMachineUser.id())
            .expirationDate("2519-04-01T08:45:00Z")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as zitadel from "@pulumiverse/zitadel";

const _default = new zitadel.PersonalAccessToken("default", {
    orgId: defaultZitadelOrg.id,
    userId: defaultZitadelMachineUser.id,
    expirationDate: "2519-04-01T08:45:00Z",
});
Copy
import pulumi
import pulumiverse_zitadel as zitadel

default = zitadel.PersonalAccessToken("default",
    org_id=default_zitadel_org["id"],
    user_id=default_zitadel_machine_user["id"],
    expiration_date="2519-04-01T08:45:00Z")
Copy
resources:
  default:
    type: zitadel:PersonalAccessToken
    properties:
      orgId: ${defaultZitadelOrg.id}
      userId: ${defaultZitadelMachineUser.id}
      expirationDate: 2519-04-01T08:45:00Z
Copy

Create PersonalAccessToken Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new PersonalAccessToken(name: string, args: PersonalAccessTokenArgs, opts?: CustomResourceOptions);
@overload
def PersonalAccessToken(resource_name: str,
                        args: PersonalAccessTokenArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def PersonalAccessToken(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        user_id: Optional[str] = None,
                        expiration_date: Optional[str] = None,
                        org_id: Optional[str] = None)
func NewPersonalAccessToken(ctx *Context, name string, args PersonalAccessTokenArgs, opts ...ResourceOption) (*PersonalAccessToken, error)
public PersonalAccessToken(string name, PersonalAccessTokenArgs args, CustomResourceOptions? opts = null)
public PersonalAccessToken(String name, PersonalAccessTokenArgs args)
public PersonalAccessToken(String name, PersonalAccessTokenArgs args, CustomResourceOptions options)
type: zitadel:PersonalAccessToken
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. PersonalAccessTokenArgs
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. PersonalAccessTokenArgs
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. PersonalAccessTokenArgs
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. PersonalAccessTokenArgs
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. PersonalAccessTokenArgs
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 personalAccessTokenResource = new Zitadel.PersonalAccessToken("personalAccessTokenResource", new()
{
    UserId = "string",
    ExpirationDate = "string",
    OrgId = "string",
});
Copy
example, err := zitadel.NewPersonalAccessToken(ctx, "personalAccessTokenResource", &zitadel.PersonalAccessTokenArgs{
	UserId:         pulumi.String("string"),
	ExpirationDate: pulumi.String("string"),
	OrgId:          pulumi.String("string"),
})
Copy
var personalAccessTokenResource = new PersonalAccessToken("personalAccessTokenResource", PersonalAccessTokenArgs.builder()
    .userId("string")
    .expirationDate("string")
    .orgId("string")
    .build());
Copy
personal_access_token_resource = zitadel.PersonalAccessToken("personalAccessTokenResource",
    user_id="string",
    expiration_date="string",
    org_id="string")
Copy
const personalAccessTokenResource = new zitadel.PersonalAccessToken("personalAccessTokenResource", {
    userId: "string",
    expirationDate: "string",
    orgId: "string",
});
Copy
type: zitadel:PersonalAccessToken
properties:
    expirationDate: string
    orgId: string
    userId: string
Copy

PersonalAccessToken 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 PersonalAccessToken resource accepts the following input properties:

UserId
This property is required.
Changes to this property will trigger replacement.
string
ID of the user
ExpirationDate Changes to this property will trigger replacement. string
Expiration date of the token in the RFC3339 format
OrgId Changes to this property will trigger replacement. string
ID of the organization
UserId
This property is required.
Changes to this property will trigger replacement.
string
ID of the user
ExpirationDate Changes to this property will trigger replacement. string
Expiration date of the token in the RFC3339 format
OrgId Changes to this property will trigger replacement. string
ID of the organization
userId
This property is required.
Changes to this property will trigger replacement.
String
ID of the user
expirationDate Changes to this property will trigger replacement. String
Expiration date of the token in the RFC3339 format
orgId Changes to this property will trigger replacement. String
ID of the organization
userId
This property is required.
Changes to this property will trigger replacement.
string
ID of the user
expirationDate Changes to this property will trigger replacement. string
Expiration date of the token in the RFC3339 format
orgId Changes to this property will trigger replacement. string
ID of the organization
user_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the user
expiration_date Changes to this property will trigger replacement. str
Expiration date of the token in the RFC3339 format
org_id Changes to this property will trigger replacement. str
ID of the organization
userId
This property is required.
Changes to this property will trigger replacement.
String
ID of the user
expirationDate Changes to this property will trigger replacement. String
Expiration date of the token in the RFC3339 format
orgId Changes to this property will trigger replacement. String
ID of the organization

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Token string
Value of the token
Id string
The provider-assigned unique ID for this managed resource.
Token string
Value of the token
id String
The provider-assigned unique ID for this managed resource.
token String
Value of the token
id string
The provider-assigned unique ID for this managed resource.
token string
Value of the token
id str
The provider-assigned unique ID for this managed resource.
token str
Value of the token
id String
The provider-assigned unique ID for this managed resource.
token String
Value of the token

Look up Existing PersonalAccessToken Resource

Get an existing PersonalAccessToken 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?: PersonalAccessTokenState, opts?: CustomResourceOptions): PersonalAccessToken
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        expiration_date: Optional[str] = None,
        org_id: Optional[str] = None,
        token: Optional[str] = None,
        user_id: Optional[str] = None) -> PersonalAccessToken
func GetPersonalAccessToken(ctx *Context, name string, id IDInput, state *PersonalAccessTokenState, opts ...ResourceOption) (*PersonalAccessToken, error)
public static PersonalAccessToken Get(string name, Input<string> id, PersonalAccessTokenState? state, CustomResourceOptions? opts = null)
public static PersonalAccessToken get(String name, Output<String> id, PersonalAccessTokenState state, CustomResourceOptions options)
resources:  _:    type: zitadel:PersonalAccessToken    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.
The following state arguments are supported:
ExpirationDate Changes to this property will trigger replacement. string
Expiration date of the token in the RFC3339 format
OrgId Changes to this property will trigger replacement. string
ID of the organization
Token string
Value of the token
UserId Changes to this property will trigger replacement. string
ID of the user
ExpirationDate Changes to this property will trigger replacement. string
Expiration date of the token in the RFC3339 format
OrgId Changes to this property will trigger replacement. string
ID of the organization
Token string
Value of the token
UserId Changes to this property will trigger replacement. string
ID of the user
expirationDate Changes to this property will trigger replacement. String
Expiration date of the token in the RFC3339 format
orgId Changes to this property will trigger replacement. String
ID of the organization
token String
Value of the token
userId Changes to this property will trigger replacement. String
ID of the user
expirationDate Changes to this property will trigger replacement. string
Expiration date of the token in the RFC3339 format
orgId Changes to this property will trigger replacement. string
ID of the organization
token string
Value of the token
userId Changes to this property will trigger replacement. string
ID of the user
expiration_date Changes to this property will trigger replacement. str
Expiration date of the token in the RFC3339 format
org_id Changes to this property will trigger replacement. str
ID of the organization
token str
Value of the token
user_id Changes to this property will trigger replacement. str
ID of the user
expirationDate Changes to this property will trigger replacement. String
Expiration date of the token in the RFC3339 format
orgId Changes to this property will trigger replacement. String
ID of the organization
token String
Value of the token
userId Changes to this property will trigger replacement. String
ID of the user

Import

bash The resource can be imported using the ID format <id:user_id[:org_id][:token]>, e.g.

 $ pulumi import zitadel:index/personalAccessToken:PersonalAccessToken imported '123456789012345678:123456789012345678:123456789012345678:LHt79...'
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
zitadel pulumiverse/pulumi-zitadel
License
Apache-2.0
Notes
This Pulumi package is based on the zitadel Terraform Provider.