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)
type: harness:platform:Token
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 TokenArgs
- 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 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 string
- The unique name of the resource.
- args TokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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,
});
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),
})
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());
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)
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,
});
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
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
The Token resource accepts the following input properties:
- Account
Id string - Account Identifier for the Entity
- Apikey
Id string - Identifier of the API Key
- Apikey
Type string - Type of the API Key
- Identifier string
- Unique identifier of the resource.
- Parent
Id 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
- Encoded
Password string - Encoded password of the Token
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- Scheduled
Expire intTime - Scheduled expiry time in milliseconds
- 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.
- 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
- Account
Id string - Account Identifier for the Entity
- Apikey
Id string - Identifier of the API Key
- Apikey
Type string - Type of the API Key
- Identifier string
- Unique identifier of the resource.
- Parent
Id 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
- Encoded
Password string - Encoded password of the Token
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Project
Id string - Unique identifier of the project.
- Scheduled
Expire intTime - Scheduled expiry time in milliseconds
- []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.
- 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
- account
Id String - Account Identifier for the Entity
- apikey
Id String - Identifier of the API Key
- apikey
Type String - Type of the API Key
- identifier String
- Unique identifier of the resource.
- parent
Id 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
- encoded
Password String - Encoded password of the Token
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- scheduled
Expire IntegerTime - Scheduled expiry time in milliseconds
- 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.
- valid
From Integer - This is the time from which the Token is valid. The time is in milliseconds
- valid
To Integer - This is the time till which the Token is valid. The time is in milliseconds
- account
Id string - Account Identifier for the Entity
- apikey
Id string - Identifier of the API Key
- apikey
Type string - Type of the API Key
- identifier string
- Unique identifier of the resource.
- parent
Id 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
- encoded
Password string - Encoded password of the Token
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- project
Id string - Unique identifier of the project.
- scheduled
Expire numberTime - Scheduled expiry time in milliseconds
- 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.
- valid
From number - This is the time from which the Token is valid. The time is in milliseconds
- valid
To number - This is the time till which the Token is valid. The time is in milliseconds
- account_
id str - Account Identifier for the Entity
- apikey_
id str - Identifier of the API Key
- apikey_
type str - Type of the API Key
- identifier str
- Unique identifier of the resource.
- parent_
id 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_ inttime - Scheduled expiry time in milliseconds
- 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
- account
Id String - Account Identifier for the Entity
- apikey
Id String - Identifier of the API Key
- apikey
Type String - Type of the API Key
- identifier String
- Unique identifier of the resource.
- parent
Id 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
- encoded
Password String - Encoded password of the Token
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- project
Id String - Unique identifier of the project.
- scheduled
Expire NumberTime - Scheduled expiry time in milliseconds
- 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.
- valid
From Number - This is the time from which the Token is valid. The time is in milliseconds
- valid
To 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:
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)
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.
- Account
Id string - Account Identifier for the Entity
- Apikey
Id string - Identifier of the API Key
- Apikey
Type string - Type of the API Key
- Description string
- Description of the resource.
- Email string
- Email Id of the user who created the Token
- Encoded
Password string - Encoded password of the Token
- Identifier string
- Unique identifier of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Parent
Id string - Parent Entity Identifier of the API Key
- Project
Id string - Unique identifier of the project.
- Scheduled
Expire intTime - Scheduled expiry time in milliseconds
- 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.
- 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 string
- Value of the Token
- Account
Id string - Account Identifier for the Entity
- Apikey
Id string - Identifier of the API Key
- Apikey
Type string - Type of the API Key
- Description string
- Description of the resource.
- Email string
- Email Id of the user who created the Token
- Encoded
Password string - Encoded password of the Token
- Identifier string
- Unique identifier of the resource.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Parent
Id string - Parent Entity Identifier of the API Key
- Project
Id string - Unique identifier of the project.
- Scheduled
Expire intTime - Scheduled expiry time in milliseconds
- []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.
- 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 string
- Value of the Token
- account
Id String - Account Identifier for the Entity
- apikey
Id String - Identifier of the API Key
- apikey
Type String - Type of the API Key
- description String
- Description of the resource.
- email String
- Email Id of the user who created the Token
- encoded
Password String - Encoded password of the Token
- identifier String
- Unique identifier of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- parent
Id String - Parent Entity Identifier of the API Key
- project
Id String - Unique identifier of the project.
- scheduled
Expire IntegerTime - Scheduled expiry time in milliseconds
- 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.
- valid
From Integer - This is the time from which the Token is valid. The time is in milliseconds
- valid
To Integer - This is the time till which the Token is valid. The time is in milliseconds
- value String
- Value of the Token
- account
Id string - Account Identifier for the Entity
- apikey
Id string - Identifier of the API Key
- apikey
Type string - Type of the API Key
- description string
- Description of the resource.
- email string
- Email Id of the user who created the Token
- encoded
Password string - Encoded password of the Token
- identifier string
- Unique identifier of the resource.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- parent
Id string - Parent Entity Identifier of the API Key
- project
Id string - Unique identifier of the project.
- scheduled
Expire numberTime - Scheduled expiry time in milliseconds
- 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.
- valid
From number - This is the time from which the Token is valid. The time is in milliseconds
- valid
To 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 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_ inttime - Scheduled expiry time in milliseconds
- 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
- account
Id String - Account Identifier for the Entity
- apikey
Id String - Identifier of the API Key
- apikey
Type String - Type of the API Key
- description String
- Description of the resource.
- email String
- Email Id of the user who created the Token
- encoded
Password String - Encoded password of the Token
- identifier String
- Unique identifier of the resource.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- parent
Id String - Parent Entity Identifier of the API Key
- project
Id String - Unique identifier of the project.
- scheduled
Expire NumberTime - Scheduled expiry time in milliseconds
- 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.
- valid
From Number - This is the time from which the Token is valid. The time is in milliseconds
- valid
To 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>
Import org level token
$ pulumi import harness:platform/token:Token harness_platform_token <org_id>/<parent_id>/<apikey_id>/<apikey_type>/<token_id>
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>
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.