1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. Token
Harness v0.7.2 published on Tuesday, Apr 15, 2025 by Pulumi

harness.platform.Token

Explore with Pulumi AI

Example Usage

Create Token Resource

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

Constructor syntax

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

@overload
def Token(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          identifier: Optional[str] = None,
          apikey_id: Optional[str] = None,
          apikey_type: Optional[str] = None,
          parent_id: Optional[str] = None,
          account_id: Optional[str] = None,
          org_id: Optional[str] = None,
          encoded_password: Optional[str] = None,
          name: Optional[str] = None,
          email: Optional[str] = None,
          description: Optional[str] = None,
          project_id: Optional[str] = None,
          scheduled_expire_time: Optional[int] = None,
          tags: Optional[Sequence[str]] = None,
          username: Optional[str] = None,
          valid: Optional[bool] = None,
          valid_from: Optional[int] = None,
          valid_to: Optional[int] = None)
func NewToken(ctx *Context, name string, args TokenArgs, opts ...ResourceOption) (*Token, error)
public Token(string name, TokenArgs args, CustomResourceOptions? opts = null)
public Token(String name, TokenArgs args)
public Token(String name, TokenArgs args, CustomResourceOptions options)
type: harness:platform:Token
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. TokenArgs
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. TokenArgs
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. TokenArgs
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. TokenArgs
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. TokenArgs
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 tokenResource = new Harness.Platform.Token("tokenResource", new()
{
    Identifier = "string",
    ApikeyId = "string",
    ApikeyType = "string",
    ParentId = "string",
    AccountId = "string",
    OrgId = "string",
    EncodedPassword = "string",
    Name = "string",
    Email = "string",
    Description = "string",
    ProjectId = "string",
    ScheduledExpireTime = 0,
    Tags = new[]
    {
        "string",
    },
    Username = "string",
    Valid = false,
    ValidFrom = 0,
    ValidTo = 0,
});
Copy
example, err := platform.NewToken(ctx, "tokenResource", &platform.TokenArgs{
	Identifier:          pulumi.String("string"),
	ApikeyId:            pulumi.String("string"),
	ApikeyType:          pulumi.String("string"),
	ParentId:            pulumi.String("string"),
	AccountId:           pulumi.String("string"),
	OrgId:               pulumi.String("string"),
	EncodedPassword:     pulumi.String("string"),
	Name:                pulumi.String("string"),
	Email:               pulumi.String("string"),
	Description:         pulumi.String("string"),
	ProjectId:           pulumi.String("string"),
	ScheduledExpireTime: pulumi.Int(0),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
	Username:  pulumi.String("string"),
	Valid:     pulumi.Bool(false),
	ValidFrom: pulumi.Int(0),
	ValidTo:   pulumi.Int(0),
})
Copy
var tokenResource = new Token("tokenResource", TokenArgs.builder()
    .identifier("string")
    .apikeyId("string")
    .apikeyType("string")
    .parentId("string")
    .accountId("string")
    .orgId("string")
    .encodedPassword("string")
    .name("string")
    .email("string")
    .description("string")
    .projectId("string")
    .scheduledExpireTime(0)
    .tags("string")
    .username("string")
    .valid(false)
    .validFrom(0)
    .validTo(0)
    .build());
Copy
token_resource = harness.platform.Token("tokenResource",
    identifier="string",
    apikey_id="string",
    apikey_type="string",
    parent_id="string",
    account_id="string",
    org_id="string",
    encoded_password="string",
    name="string",
    email="string",
    description="string",
    project_id="string",
    scheduled_expire_time=0,
    tags=["string"],
    username="string",
    valid=False,
    valid_from=0,
    valid_to=0)
Copy
const tokenResource = new harness.platform.Token("tokenResource", {
    identifier: "string",
    apikeyId: "string",
    apikeyType: "string",
    parentId: "string",
    accountId: "string",
    orgId: "string",
    encodedPassword: "string",
    name: "string",
    email: "string",
    description: "string",
    projectId: "string",
    scheduledExpireTime: 0,
    tags: ["string"],
    username: "string",
    valid: false,
    validFrom: 0,
    validTo: 0,
});
Copy
type: harness:platform:Token
properties:
    accountId: string
    apikeyId: string
    apikeyType: string
    description: string
    email: string
    encodedPassword: string
    identifier: string
    name: string
    orgId: string
    parentId: string
    projectId: string
    scheduledExpireTime: 0
    tags:
        - string
    username: string
    valid: false
    validFrom: 0
    validTo: 0
Copy

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

AccountId This property is required. string
Account Identifier for the Entity
ApikeyId This property is required. string
Identifier of the API Key
ApikeyType This property is required. string
Type of the API Key
Identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource.
ParentId This property is required. string
Parent Entity Identifier of the API Key
Description string
Description of the resource.
Email string
Email Id of the user who created the Token
EncodedPassword string
Encoded password of the Token
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
ProjectId string
Unique identifier of the project.
ScheduledExpireTime int
Scheduled expiry time in milliseconds
Tags List<string>
Tags to associate with the resource.
Username string
Name of the user who created the Token
Valid bool
Boolean value to indicate if Token is valid or not.
ValidFrom int
This is the time from which the Token is valid. The time is in milliseconds
ValidTo int
This is the time till which the Token is valid. The time is in milliseconds
AccountId This property is required. string
Account Identifier for the Entity
ApikeyId This property is required. string
Identifier of the API Key
ApikeyType This property is required. string
Type of the API Key
Identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource.
ParentId This property is required. string
Parent Entity Identifier of the API Key
Description string
Description of the resource.
Email string
Email Id of the user who created the Token
EncodedPassword string
Encoded password of the Token
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
ProjectId string
Unique identifier of the project.
ScheduledExpireTime int
Scheduled expiry time in milliseconds
Tags []string
Tags to associate with the resource.
Username string
Name of the user who created the Token
Valid bool
Boolean value to indicate if Token is valid or not.
ValidFrom int
This is the time from which the Token is valid. The time is in milliseconds
ValidTo int
This is the time till which the Token is valid. The time is in milliseconds
accountId This property is required. String
Account Identifier for the Entity
apikeyId This property is required. String
Identifier of the API Key
apikeyType This property is required. String
Type of the API Key
identifier
This property is required.
Changes to this property will trigger replacement.
String
Unique identifier of the resource.
parentId This property is required. String
Parent Entity Identifier of the API Key
description String
Description of the resource.
email String
Email Id of the user who created the Token
encodedPassword String
Encoded password of the Token
name String
Name of the resource.
orgId String
Unique identifier of the organization.
projectId String
Unique identifier of the project.
scheduledExpireTime Integer
Scheduled expiry time in milliseconds
tags List<String>
Tags to associate with the resource.
username String
Name of the user who created the Token
valid Boolean
Boolean value to indicate if Token is valid or not.
validFrom Integer
This is the time from which the Token is valid. The time is in milliseconds
validTo Integer
This is the time till which the Token is valid. The time is in milliseconds
accountId This property is required. string
Account Identifier for the Entity
apikeyId This property is required. string
Identifier of the API Key
apikeyType This property is required. string
Type of the API Key
identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource.
parentId This property is required. string
Parent Entity Identifier of the API Key
description string
Description of the resource.
email string
Email Id of the user who created the Token
encodedPassword string
Encoded password of the Token
name string
Name of the resource.
orgId string
Unique identifier of the organization.
projectId string
Unique identifier of the project.
scheduledExpireTime number
Scheduled expiry time in milliseconds
tags string[]
Tags to associate with the resource.
username string
Name of the user who created the Token
valid boolean
Boolean value to indicate if Token is valid or not.
validFrom number
This is the time from which the Token is valid. The time is in milliseconds
validTo number
This is the time till which the Token is valid. The time is in milliseconds
account_id This property is required. str
Account Identifier for the Entity
apikey_id This property is required. str
Identifier of the API Key
apikey_type This property is required. str
Type of the API Key
identifier
This property is required.
Changes to this property will trigger replacement.
str
Unique identifier of the resource.
parent_id This property is required. str
Parent Entity Identifier of the API Key
description str
Description of the resource.
email str
Email Id of the user who created the Token
encoded_password str
Encoded password of the Token
name str
Name of the resource.
org_id str
Unique identifier of the organization.
project_id str
Unique identifier of the project.
scheduled_expire_time int
Scheduled expiry time in milliseconds
tags Sequence[str]
Tags to associate with the resource.
username str
Name of the user who created the Token
valid bool
Boolean value to indicate if Token is valid or not.
valid_from int
This is the time from which the Token is valid. The time is in milliseconds
valid_to int
This is the time till which the Token is valid. The time is in milliseconds
accountId This property is required. String
Account Identifier for the Entity
apikeyId This property is required. String
Identifier of the API Key
apikeyType This property is required. String
Type of the API Key
identifier
This property is required.
Changes to this property will trigger replacement.
String
Unique identifier of the resource.
parentId This property is required. String
Parent Entity Identifier of the API Key
description String
Description of the resource.
email String
Email Id of the user who created the Token
encodedPassword String
Encoded password of the Token
name String
Name of the resource.
orgId String
Unique identifier of the organization.
projectId String
Unique identifier of the project.
scheduledExpireTime Number
Scheduled expiry time in milliseconds
tags List<String>
Tags to associate with the resource.
username String
Name of the user who created the Token
valid Boolean
Boolean value to indicate if Token is valid or not.
validFrom Number
This is the time from which the Token is valid. The time is in milliseconds
validTo Number
This is the time till which the Token is valid. The time is in milliseconds

Outputs

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

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

Look up Existing Token Resource

Get an existing Token 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?: TokenState, opts?: CustomResourceOptions): Token
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        apikey_id: Optional[str] = None,
        apikey_type: Optional[str] = None,
        description: Optional[str] = None,
        email: Optional[str] = None,
        encoded_password: Optional[str] = None,
        identifier: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        parent_id: Optional[str] = None,
        project_id: Optional[str] = None,
        scheduled_expire_time: Optional[int] = None,
        tags: Optional[Sequence[str]] = None,
        username: Optional[str] = None,
        valid: Optional[bool] = None,
        valid_from: Optional[int] = None,
        valid_to: Optional[int] = None,
        value: Optional[str] = None) -> Token
func GetToken(ctx *Context, name string, id IDInput, state *TokenState, opts ...ResourceOption) (*Token, error)
public static Token Get(string name, Input<string> id, TokenState? state, CustomResourceOptions? opts = null)
public static Token get(String name, Output<String> id, TokenState state, CustomResourceOptions options)
resources:  _:    type: harness:platform:Token    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:
AccountId string
Account Identifier for the Entity
ApikeyId string
Identifier of the API Key
ApikeyType string
Type of the API Key
Description string
Description of the resource.
Email string
Email Id of the user who created the Token
EncodedPassword string
Encoded password of the Token
Identifier Changes to this property will trigger replacement. string
Unique identifier of the resource.
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
ParentId string
Parent Entity Identifier of the API Key
ProjectId string
Unique identifier of the project.
ScheduledExpireTime int
Scheduled expiry time in milliseconds
Tags List<string>
Tags to associate with the resource.
Username string
Name of the user who created the Token
Valid bool
Boolean value to indicate if Token is valid or not.
ValidFrom int
This is the time from which the Token is valid. The time is in milliseconds
ValidTo int
This is the time till which the Token is valid. The time is in milliseconds
Value string
Value of the Token
AccountId string
Account Identifier for the Entity
ApikeyId string
Identifier of the API Key
ApikeyType string
Type of the API Key
Description string
Description of the resource.
Email string
Email Id of the user who created the Token
EncodedPassword string
Encoded password of the Token
Identifier Changes to this property will trigger replacement. string
Unique identifier of the resource.
Name string
Name of the resource.
OrgId string
Unique identifier of the organization.
ParentId string
Parent Entity Identifier of the API Key
ProjectId string
Unique identifier of the project.
ScheduledExpireTime int
Scheduled expiry time in milliseconds
Tags []string
Tags to associate with the resource.
Username string
Name of the user who created the Token
Valid bool
Boolean value to indicate if Token is valid or not.
ValidFrom int
This is the time from which the Token is valid. The time is in milliseconds
ValidTo int
This is the time till which the Token is valid. The time is in milliseconds
Value string
Value of the Token
accountId String
Account Identifier for the Entity
apikeyId String
Identifier of the API Key
apikeyType String
Type of the API Key
description String
Description of the resource.
email String
Email Id of the user who created the Token
encodedPassword String
Encoded password of the Token
identifier Changes to this property will trigger replacement. String
Unique identifier of the resource.
name String
Name of the resource.
orgId String
Unique identifier of the organization.
parentId String
Parent Entity Identifier of the API Key
projectId String
Unique identifier of the project.
scheduledExpireTime Integer
Scheduled expiry time in milliseconds
tags List<String>
Tags to associate with the resource.
username String
Name of the user who created the Token
valid Boolean
Boolean value to indicate if Token is valid or not.
validFrom Integer
This is the time from which the Token is valid. The time is in milliseconds
validTo Integer
This is the time till which the Token is valid. The time is in milliseconds
value String
Value of the Token
accountId string
Account Identifier for the Entity
apikeyId string
Identifier of the API Key
apikeyType string
Type of the API Key
description string
Description of the resource.
email string
Email Id of the user who created the Token
encodedPassword string
Encoded password of the Token
identifier Changes to this property will trigger replacement. string
Unique identifier of the resource.
name string
Name of the resource.
orgId string
Unique identifier of the organization.
parentId string
Parent Entity Identifier of the API Key
projectId string
Unique identifier of the project.
scheduledExpireTime number
Scheduled expiry time in milliseconds
tags string[]
Tags to associate with the resource.
username string
Name of the user who created the Token
valid boolean
Boolean value to indicate if Token is valid or not.
validFrom number
This is the time from which the Token is valid. The time is in milliseconds
validTo number
This is the time till which the Token is valid. The time is in milliseconds
value string
Value of the Token
account_id str
Account Identifier for the Entity
apikey_id str
Identifier of the API Key
apikey_type str
Type of the API Key
description str
Description of the resource.
email str
Email Id of the user who created the Token
encoded_password str
Encoded password of the Token
identifier Changes to this property will trigger replacement. str
Unique identifier of the resource.
name str
Name of the resource.
org_id str
Unique identifier of the organization.
parent_id str
Parent Entity Identifier of the API Key
project_id str
Unique identifier of the project.
scheduled_expire_time int
Scheduled expiry time in milliseconds
tags Sequence[str]
Tags to associate with the resource.
username str
Name of the user who created the Token
valid bool
Boolean value to indicate if Token is valid or not.
valid_from int
This is the time from which the Token is valid. The time is in milliseconds
valid_to int
This is the time till which the Token is valid. The time is in milliseconds
value str
Value of the Token
accountId String
Account Identifier for the Entity
apikeyId String
Identifier of the API Key
apikeyType String
Type of the API Key
description String
Description of the resource.
email String
Email Id of the user who created the Token
encodedPassword String
Encoded password of the Token
identifier Changes to this property will trigger replacement. String
Unique identifier of the resource.
name String
Name of the resource.
orgId String
Unique identifier of the organization.
parentId String
Parent Entity Identifier of the API Key
projectId String
Unique identifier of the project.
scheduledExpireTime Number
Scheduled expiry time in milliseconds
tags List<String>
Tags to associate with the resource.
username String
Name of the user who created the Token
valid Boolean
Boolean value to indicate if Token is valid or not.
validFrom Number
This is the time from which the Token is valid. The time is in milliseconds
validTo Number
This is the time till which the Token is valid. The time is in milliseconds
value String
Value of the Token

Import

Import account level token

$ pulumi import harness:platform/token:Token harness_platform_token <parent_id>/<apikey_id>/<apikey_type>/<token_id>
Copy

Import org level token

$ pulumi import harness:platform/token:Token harness_platform_token <org_id>/<parent_id>/<apikey_id>/<apikey_type>/<token_id>
Copy

Import project level token

$ pulumi import harness:platform/token:Token harness_platform_token <org_id>/<project_id>/<parent_id>/<apikey_id>/<apikey_type>/<token_id>
Copy

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

Package Details

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