published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski
published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski
Deprecated: Use
proxmoxve.user.Tokeninstead. This resource will be removed in v1.0.
User API tokens.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
// if creating a user token, the user must be created first
const user = new proxmoxve.UserLegacy("user", {
comment: "Managed by Pulumi",
email: "user@pve",
enabled: true,
expirationDate: "2034-01-01T22:00:00Z",
userId: "user@pve",
});
const userToken = new proxmoxve.user.TokenLegacy("user_token", {
comment: "Managed by Pulumi",
expirationDate: "2033-01-01T22:00:00Z",
tokenName: "tk1",
userId: user.userId,
});
import pulumi
import pulumi_proxmoxve as proxmoxve
# if creating a user token, the user must be created first
user = proxmoxve.UserLegacy("user",
comment="Managed by Pulumi",
email="user@pve",
enabled=True,
expiration_date="2034-01-01T22:00:00Z",
user_id="user@pve")
user_token = proxmoxve.user.TokenLegacy("user_token",
comment="Managed by Pulumi",
expiration_date="2033-01-01T22:00:00Z",
token_name="tk1",
user_id=user.user_id)
package main
import (
"github.com/muhlba91/pulumi-proxmoxve/sdk/v8/go/proxmoxve"
"github.com/muhlba91/pulumi-proxmoxve/sdk/v8/go/proxmoxve/user"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// if creating a user token, the user must be created first
user, err := proxmoxve.NewUserLegacy(ctx, "user", &proxmoxve.UserLegacyArgs{
Comment: pulumi.String("Managed by Pulumi"),
Email: pulumi.String("user@pve"),
Enabled: pulumi.Bool(true),
ExpirationDate: pulumi.String("2034-01-01T22:00:00Z"),
UserId: pulumi.String("user@pve"),
})
if err != nil {
return err
}
_, err = user.NewTokenLegacy(ctx, "user_token", &user.TokenLegacyArgs{
Comment: pulumi.String("Managed by Pulumi"),
ExpirationDate: pulumi.String("2033-01-01T22:00:00Z"),
TokenName: pulumi.String("tk1"),
UserId: user.UserId,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;
return await Deployment.RunAsync(() =>
{
// if creating a user token, the user must be created first
var user = new ProxmoxVE.Index.UserLegacy("user", new()
{
Comment = "Managed by Pulumi",
Email = "user@pve",
Enabled = true,
ExpirationDate = "2034-01-01T22:00:00Z",
UserId = "user@pve",
});
var userToken = new ProxmoxVE.User.TokenLegacy("user_token", new()
{
Comment = "Managed by Pulumi",
ExpirationDate = "2033-01-01T22:00:00Z",
TokenName = "tk1",
UserId = user.UserId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import io.muehlbachler.pulumi.proxmoxve.UserLegacy;
import io.muehlbachler.pulumi.proxmoxve.UserLegacyArgs;
import io.muehlbachler.pulumi.proxmoxve.user.TokenLegacy;
import io.muehlbachler.pulumi.proxmoxve.user.TokenLegacyArgs;
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) {
// if creating a user token, the user must be created first
var user = new UserLegacy("user", UserLegacyArgs.builder()
.comment("Managed by Pulumi")
.email("user@pve")
.enabled(true)
.expirationDate("2034-01-01T22:00:00Z")
.userId("user@pve")
.build());
var userToken = new TokenLegacy("userToken", TokenLegacyArgs.builder()
.comment("Managed by Pulumi")
.expirationDate("2033-01-01T22:00:00Z")
.tokenName("tk1")
.userId(user.userId())
.build());
}
}
resources:
# if creating a user token, the user must be created first
user:
type: proxmoxve:UserLegacy
properties:
comment: Managed by Pulumi
email: user@pve
enabled: true
expirationDate: 2034-01-01T22:00:00Z
userId: user@pve
userToken:
type: proxmoxve:user:TokenLegacy
name: user_token
properties:
comment: Managed by Pulumi
expirationDate: 2033-01-01T22:00:00Z
tokenName: tk1
userId: ${user.userId}
Create TokenLegacy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TokenLegacy(name: string, args: TokenLegacyArgs, opts?: CustomResourceOptions);@overload
def TokenLegacy(resource_name: str,
args: TokenLegacyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TokenLegacy(resource_name: str,
opts: Optional[ResourceOptions] = None,
token_name: Optional[str] = None,
user_id: Optional[str] = None,
comment: Optional[str] = None,
expiration_date: Optional[str] = None,
privileges_separation: Optional[bool] = None)func NewTokenLegacy(ctx *Context, name string, args TokenLegacyArgs, opts ...ResourceOption) (*TokenLegacy, error)public TokenLegacy(string name, TokenLegacyArgs args, CustomResourceOptions? opts = null)
public TokenLegacy(String name, TokenLegacyArgs args)
public TokenLegacy(String name, TokenLegacyArgs args, CustomResourceOptions options)
type: proxmoxve:user:TokenLegacy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TokenLegacyArgs
- 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 TokenLegacyArgs
- 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 TokenLegacyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TokenLegacyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TokenLegacyArgs
- 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 tokenLegacyResource = new ProxmoxVE.User.TokenLegacy("tokenLegacyResource", new()
{
TokenName = "string",
UserId = "string",
Comment = "string",
ExpirationDate = "string",
PrivilegesSeparation = false,
});
example, err := user.NewTokenLegacy(ctx, "tokenLegacyResource", &user.TokenLegacyArgs{
TokenName: pulumi.String("string"),
UserId: pulumi.String("string"),
Comment: pulumi.String("string"),
ExpirationDate: pulumi.String("string"),
PrivilegesSeparation: pulumi.Bool(false),
})
var tokenLegacyResource = new TokenLegacy("tokenLegacyResource", TokenLegacyArgs.builder()
.tokenName("string")
.userId("string")
.comment("string")
.expirationDate("string")
.privilegesSeparation(false)
.build());
token_legacy_resource = proxmoxve.user.TokenLegacy("tokenLegacyResource",
token_name="string",
user_id="string",
comment="string",
expiration_date="string",
privileges_separation=False)
const tokenLegacyResource = new proxmoxve.user.TokenLegacy("tokenLegacyResource", {
tokenName: "string",
userId: "string",
comment: "string",
expirationDate: "string",
privilegesSeparation: false,
});
type: proxmoxve:user:TokenLegacy
properties:
comment: string
expirationDate: string
privilegesSeparation: false
tokenName: string
userId: string
TokenLegacy 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 TokenLegacy resource accepts the following input properties:
- Token
Name string - User-specific token identifier.
- User
Id string - User identifier.
- Comment string
- Comment for the token.
- Expiration
Date string - Expiration date for the token.
- Privileges
Separation bool - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- Token
Name string - User-specific token identifier.
- User
Id string - User identifier.
- Comment string
- Comment for the token.
- Expiration
Date string - Expiration date for the token.
- Privileges
Separation bool - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token
Name String - User-specific token identifier.
- user
Id String - User identifier.
- comment String
- Comment for the token.
- expiration
Date String - Expiration date for the token.
- privileges
Separation Boolean - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token
Name string - User-specific token identifier.
- user
Id string - User identifier.
- comment string
- Comment for the token.
- expiration
Date string - Expiration date for the token.
- privileges
Separation boolean - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token_
name str - User-specific token identifier.
- user_
id str - User identifier.
- comment str
- Comment for the token.
- expiration_
date str - Expiration date for the token.
- privileges_
separation bool - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token
Name String - User-specific token identifier.
- user
Id String - User identifier.
- comment String
- Comment for the token.
- expiration
Date String - Expiration date for the token.
- privileges
Separation Boolean - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
Outputs
All input properties are implicitly available as output properties. Additionally, the TokenLegacy resource produces the following output properties:
Look up Existing TokenLegacy Resource
Get an existing TokenLegacy 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?: TokenLegacyState, opts?: CustomResourceOptions): TokenLegacy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
comment: Optional[str] = None,
expiration_date: Optional[str] = None,
privileges_separation: Optional[bool] = None,
token_name: Optional[str] = None,
user_id: Optional[str] = None,
value: Optional[str] = None) -> TokenLegacyfunc GetTokenLegacy(ctx *Context, name string, id IDInput, state *TokenLegacyState, opts ...ResourceOption) (*TokenLegacy, error)public static TokenLegacy Get(string name, Input<string> id, TokenLegacyState? state, CustomResourceOptions? opts = null)public static TokenLegacy get(String name, Output<String> id, TokenLegacyState state, CustomResourceOptions options)resources: _: type: proxmoxve:user:TokenLegacy get: id: ${id}- 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.
- Comment string
- Comment for the token.
- Expiration
Date string - Expiration date for the token.
- Privileges
Separation bool - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- Token
Name string - User-specific token identifier.
- User
Id string - User identifier.
- Value string
- API token value used for authentication. It is populated only when creating a new token, and can't be retrieved at import.
- Comment string
- Comment for the token.
- Expiration
Date string - Expiration date for the token.
- Privileges
Separation bool - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- Token
Name string - User-specific token identifier.
- User
Id string - User identifier.
- Value string
- API token value used for authentication. It is populated only when creating a new token, and can't be retrieved at import.
- comment String
- Comment for the token.
- expiration
Date String - Expiration date for the token.
- privileges
Separation Boolean - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token
Name String - User-specific token identifier.
- user
Id String - User identifier.
- value String
- API token value used for authentication. It is populated only when creating a new token, and can't be retrieved at import.
- comment string
- Comment for the token.
- expiration
Date string - Expiration date for the token.
- privileges
Separation boolean - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token
Name string - User-specific token identifier.
- user
Id string - User identifier.
- value string
- API token value used for authentication. It is populated only when creating a new token, and can't be retrieved at import.
- comment str
- Comment for the token.
- expiration_
date str - Expiration date for the token.
- privileges_
separation bool - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token_
name str - User-specific token identifier.
- user_
id str - User identifier.
- value str
- API token value used for authentication. It is populated only when creating a new token, and can't be retrieved at import.
- comment String
- Comment for the token.
- expiration
Date String - Expiration date for the token.
- privileges
Separation Boolean - Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
- token
Name String - User-specific token identifier.
- user
Id String - User identifier.
- value String
- API token value used for authentication. It is populated only when creating a new token, and can't be retrieved at import.
Import
!/usr/bin/env sh
Tokens can be imported using they identifiers in format user_id!token_name format, e.g.:
$ pulumi import proxmoxve:user/tokenLegacy:TokenLegacy token1 user@pve!token1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- proxmoxve muhlba91/pulumi-proxmoxve
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
proxmoxTerraform Provider.
published on Sunday, Apr 5, 2026 by Daniel Muehlbachler-Pietrzykowski
