harness.platform.Delegatetoken
Explore with Pulumi AI
Resource for creating delegate tokens. Delegate tokens can be created and revoked. Revoked tokens immediately stop functioning and are only purged after 30 days, meaning you cannot recreate a token with the same name within that period. To revoke a token, set token_status field to “REVOKED”.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
// Create delegate token at account level
const accountLevel = new harness.platform.Delegatetoken("account_level", {
name: "account-delegate-token",
accountId: "account_id",
});
// Create delegate token at organization level
const orgLevel = new harness.platform.Delegatetoken("org_level", {
name: "org-delegate-token",
accountId: "account_id",
orgId: "org_id",
});
// Create delegate token at project level
const projectLevel = new harness.platform.Delegatetoken("project_level", {
name: "project-delegate-token",
accountId: "account_id",
orgId: "org_id",
projectId: "project_id",
});
// Create delegate token with auto-expiry
const expiryToken = new harness.platform.Delegatetoken("expiry_token", {
name: "expiry-delegate-token",
accountId: "account_id",
revokeAfter: 1769689600000,
});
import pulumi
import pulumi_harness as harness
# Create delegate token at account level
account_level = harness.platform.Delegatetoken("account_level",
name="account-delegate-token",
account_id="account_id")
# Create delegate token at organization level
org_level = harness.platform.Delegatetoken("org_level",
name="org-delegate-token",
account_id="account_id",
org_id="org_id")
# Create delegate token at project level
project_level = harness.platform.Delegatetoken("project_level",
name="project-delegate-token",
account_id="account_id",
org_id="org_id",
project_id="project_id")
# Create delegate token with auto-expiry
expiry_token = harness.platform.Delegatetoken("expiry_token",
name="expiry-delegate-token",
account_id="account_id",
revoke_after=1769689600000)
package main
import (
"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create delegate token at account level
_, err := platform.NewDelegatetoken(ctx, "account_level", &platform.DelegatetokenArgs{
Name: pulumi.String("account-delegate-token"),
AccountId: pulumi.String("account_id"),
})
if err != nil {
return err
}
// Create delegate token at organization level
_, err = platform.NewDelegatetoken(ctx, "org_level", &platform.DelegatetokenArgs{
Name: pulumi.String("org-delegate-token"),
AccountId: pulumi.String("account_id"),
OrgId: pulumi.String("org_id"),
})
if err != nil {
return err
}
// Create delegate token at project level
_, err = platform.NewDelegatetoken(ctx, "project_level", &platform.DelegatetokenArgs{
Name: pulumi.String("project-delegate-token"),
AccountId: pulumi.String("account_id"),
OrgId: pulumi.String("org_id"),
ProjectId: pulumi.String("project_id"),
})
if err != nil {
return err
}
// Create delegate token with auto-expiry
_, err = platform.NewDelegatetoken(ctx, "expiry_token", &platform.DelegatetokenArgs{
Name: pulumi.String("expiry-delegate-token"),
AccountId: pulumi.String("account_id"),
RevokeAfter: pulumi.Int(1769689600000),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() =>
{
// Create delegate token at account level
var accountLevel = new Harness.Platform.Delegatetoken("account_level", new()
{
Name = "account-delegate-token",
AccountId = "account_id",
});
// Create delegate token at organization level
var orgLevel = new Harness.Platform.Delegatetoken("org_level", new()
{
Name = "org-delegate-token",
AccountId = "account_id",
OrgId = "org_id",
});
// Create delegate token at project level
var projectLevel = new Harness.Platform.Delegatetoken("project_level", new()
{
Name = "project-delegate-token",
AccountId = "account_id",
OrgId = "org_id",
ProjectId = "project_id",
});
// Create delegate token with auto-expiry
var expiryToken = new Harness.Platform.Delegatetoken("expiry_token", new()
{
Name = "expiry-delegate-token",
AccountId = "account_id",
RevokeAfter = 1769689600000,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.Delegatetoken;
import com.pulumi.harness.platform.DelegatetokenArgs;
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) {
// Create delegate token at account level
var accountLevel = new Delegatetoken("accountLevel", DelegatetokenArgs.builder()
.name("account-delegate-token")
.accountId("account_id")
.build());
// Create delegate token at organization level
var orgLevel = new Delegatetoken("orgLevel", DelegatetokenArgs.builder()
.name("org-delegate-token")
.accountId("account_id")
.orgId("org_id")
.build());
// Create delegate token at project level
var projectLevel = new Delegatetoken("projectLevel", DelegatetokenArgs.builder()
.name("project-delegate-token")
.accountId("account_id")
.orgId("org_id")
.projectId("project_id")
.build());
// Create delegate token with auto-expiry
var expiryToken = new Delegatetoken("expiryToken", DelegatetokenArgs.builder()
.name("expiry-delegate-token")
.accountId("account_id")
.revokeAfter(1769689600000)
.build());
}
}
resources:
# Create delegate token at account level
accountLevel:
type: harness:platform:Delegatetoken
name: account_level
properties:
name: account-delegate-token
accountId: account_id
# Create delegate token at organization level
orgLevel:
type: harness:platform:Delegatetoken
name: org_level
properties:
name: org-delegate-token
accountId: account_id
orgId: org_id
# Create delegate token at project level
projectLevel:
type: harness:platform:Delegatetoken
name: project_level
properties:
name: project-delegate-token
accountId: account_id
orgId: org_id
projectId: project_id
# Create delegate token with auto-expiry
expiryToken:
type: harness:platform:Delegatetoken
name: expiry_token
properties:
name: expiry-delegate-token
accountId: account_id
revokeAfter: 1.7696896e+12 # Unix timestamp in milliseconds for token auto-expiration
Create Delegatetoken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Delegatetoken(name: string, args: DelegatetokenArgs, opts?: CustomResourceOptions);
@overload
def Delegatetoken(resource_name: str,
args: DelegatetokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Delegatetoken(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
created_at: Optional[int] = None,
created_by: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
project_id: Optional[str] = None,
revoke_after: Optional[int] = None,
token_status: Optional[str] = None,
value: Optional[str] = None)
func NewDelegatetoken(ctx *Context, name string, args DelegatetokenArgs, opts ...ResourceOption) (*Delegatetoken, error)
public Delegatetoken(string name, DelegatetokenArgs args, CustomResourceOptions? opts = null)
public Delegatetoken(String name, DelegatetokenArgs args)
public Delegatetoken(String name, DelegatetokenArgs args, CustomResourceOptions options)
type: harness:platform:Delegatetoken
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 DelegatetokenArgs
- 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 DelegatetokenArgs
- 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 DelegatetokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DelegatetokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DelegatetokenArgs
- 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 delegatetokenResource = new Harness.Platform.Delegatetoken("delegatetokenResource", new()
{
AccountId = "string",
CreatedAt = 0,
CreatedBy =
{
{ "string", "string" },
},
Name = "string",
OrgId = "string",
ProjectId = "string",
RevokeAfter = 0,
TokenStatus = "string",
Value = "string",
});
example, err := platform.NewDelegatetoken(ctx, "delegatetokenResource", &platform.DelegatetokenArgs{
AccountId: pulumi.String("string"),
CreatedAt: pulumi.Int(0),
CreatedBy: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
OrgId: pulumi.String("string"),
ProjectId: pulumi.String("string"),
RevokeAfter: pulumi.Int(0),
TokenStatus: pulumi.String("string"),
Value: pulumi.String("string"),
})
var delegatetokenResource = new Delegatetoken("delegatetokenResource", DelegatetokenArgs.builder()
.accountId("string")
.createdAt(0)
.createdBy(Map.of("string", "string"))
.name("string")
.orgId("string")
.projectId("string")
.revokeAfter(0)
.tokenStatus("string")
.value("string")
.build());
delegatetoken_resource = harness.platform.Delegatetoken("delegatetokenResource",
account_id="string",
created_at=0,
created_by={
"string": "string",
},
name="string",
org_id="string",
project_id="string",
revoke_after=0,
token_status="string",
value="string")
const delegatetokenResource = new harness.platform.Delegatetoken("delegatetokenResource", {
accountId: "string",
createdAt: 0,
createdBy: {
string: "string",
},
name: "string",
orgId: "string",
projectId: "string",
revokeAfter: 0,
tokenStatus: "string",
value: "string",
});
type: harness:platform:Delegatetoken
properties:
accountId: string
createdAt: 0
createdBy:
string: string
name: string
orgId: string
projectId: string
revokeAfter: 0
tokenStatus: string
value: string
Delegatetoken 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 Delegatetoken resource accepts the following input properties:
- Account
Id string - Account Identifier for the Entity
- Created
At int - Time when the delegate token is created. This is an epoch timestamp.
- Created
By Dictionary<string, string> - created by details
- Name string
- Name of the delegate token
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Revoke
After int - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- Value string
- Value of the delegate token. Encoded in base64.
- Account
Id string - Account Identifier for the Entity
- Created
At int - Time when the delegate token is created. This is an epoch timestamp.
- Created
By map[string]string - created by details
- Name string
- Name of the delegate token
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Revoke
After int - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- Value string
- Value of the delegate token. Encoded in base64.
- account
Id String - Account Identifier for the Entity
- created
At Integer - Time when the delegate token is created. This is an epoch timestamp.
- created
By Map<String,String> - created by details
- name String
- Name of the delegate token
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- revoke
After Integer - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value String
- Value of the delegate token. Encoded in base64.
- account
Id string - Account Identifier for the Entity
- created
At number - Time when the delegate token is created. This is an epoch timestamp.
- created
By {[key: string]: string} - created by details
- name string
- Name of the delegate token
- org
Id string - Org Identifier for the Entity
- project
Id string - Project Identifier for the Entity
- revoke
After number - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value string
- Value of the delegate token. Encoded in base64.
- account_
id str - Account Identifier for the Entity
- created_
at int - Time when the delegate token is created. This is an epoch timestamp.
- created_
by Mapping[str, str] - created by details
- name str
- Name of the delegate token
- org_
id str - Org Identifier for the Entity
- project_
id str - Project Identifier for the Entity
- revoke_
after int - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token_
status str - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value str
- Value of the delegate token. Encoded in base64.
- account
Id String - Account Identifier for the Entity
- created
At Number - Time when the delegate token is created. This is an epoch timestamp.
- created
By Map<String> - created by details
- name String
- Name of the delegate token
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- revoke
After Number - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value String
- Value of the delegate token. Encoded in base64.
Outputs
All input properties are implicitly available as output properties. Additionally, the Delegatetoken resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Delegatetoken Resource
Get an existing Delegatetoken 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?: DelegatetokenState, opts?: CustomResourceOptions): Delegatetoken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
created_at: Optional[int] = None,
created_by: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
project_id: Optional[str] = None,
revoke_after: Optional[int] = None,
token_status: Optional[str] = None,
value: Optional[str] = None) -> Delegatetoken
func GetDelegatetoken(ctx *Context, name string, id IDInput, state *DelegatetokenState, opts ...ResourceOption) (*Delegatetoken, error)
public static Delegatetoken Get(string name, Input<string> id, DelegatetokenState? state, CustomResourceOptions? opts = null)
public static Delegatetoken get(String name, Output<String> id, DelegatetokenState state, CustomResourceOptions options)
resources: _: type: harness:platform:Delegatetoken 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.
- Account
Id string - Account Identifier for the Entity
- Created
At int - Time when the delegate token is created. This is an epoch timestamp.
- Created
By Dictionary<string, string> - created by details
- Name string
- Name of the delegate token
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Revoke
After int - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- Value string
- Value of the delegate token. Encoded in base64.
- Account
Id string - Account Identifier for the Entity
- Created
At int - Time when the delegate token is created. This is an epoch timestamp.
- Created
By map[string]string - created by details
- Name string
- Name of the delegate token
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Revoke
After int - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- Value string
- Value of the delegate token. Encoded in base64.
- account
Id String - Account Identifier for the Entity
- created
At Integer - Time when the delegate token is created. This is an epoch timestamp.
- created
By Map<String,String> - created by details
- name String
- Name of the delegate token
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- revoke
After Integer - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value String
- Value of the delegate token. Encoded in base64.
- account
Id string - Account Identifier for the Entity
- created
At number - Time when the delegate token is created. This is an epoch timestamp.
- created
By {[key: string]: string} - created by details
- name string
- Name of the delegate token
- org
Id string - Org Identifier for the Entity
- project
Id string - Project Identifier for the Entity
- revoke
After number - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value string
- Value of the delegate token. Encoded in base64.
- account_
id str - Account Identifier for the Entity
- created_
at int - Time when the delegate token is created. This is an epoch timestamp.
- created_
by Mapping[str, str] - created by details
- name str
- Name of the delegate token
- org_
id str - Org Identifier for the Entity
- project_
id str - Project Identifier for the Entity
- revoke_
after int - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token_
status str - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value str
- Value of the delegate token. Encoded in base64.
- account
Id String - Account Identifier for the Entity
- created
At Number - Time when the delegate token is created. This is an epoch timestamp.
- created
By Map<String> - created by details
- name String
- Name of the delegate token
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- revoke
After Number - Epoch time in milliseconds after which the token will be marked as revoked. There can be a delay of up to one hour from the epoch value provided and actual revoking of the token.
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- value String
- Value of the delegate token. Encoded in base64.
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.