Harness v0.7.6 published on Friday, Jul 11, 2025 by Pulumi
harness.platform.getDelegatetoken
Explore with Pulumi AI
Data source for retrieving a Harness delegate Token.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
// Look up a delegate token at account level by name
const accountLevel = harness.platform.getDelegatetoken({
name: "account-delegate-token",
accountId: "account_id",
});
// Look up a delegate token at organization level
const orgLevel = harness.platform.getDelegatetoken({
name: "org-delegate-token",
accountId: "account_id",
orgId: "org_id",
});
// Look up a delegate token at project level
const projectLevel = harness.platform.getDelegatetoken({
name: "project-delegate-token",
accountId: "account_id",
orgId: "org_id",
projectId: "project_id",
});
import pulumi
import pulumi_harness as harness
# Look up a delegate token at account level by name
account_level = harness.platform.get_delegatetoken(name="account-delegate-token",
account_id="account_id")
# Look up a delegate token at organization level
org_level = harness.platform.get_delegatetoken(name="org-delegate-token",
account_id="account_id",
org_id="org_id")
# Look up a delegate token at project level
project_level = harness.platform.get_delegatetoken(name="project-delegate-token",
account_id="account_id",
org_id="org_id",
project_id="project_id")
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 {
// Look up a delegate token at account level by name
_, err := platform.LookupDelegatetoken(ctx, &platform.LookupDelegatetokenArgs{
Name: "account-delegate-token",
AccountId: "account_id",
}, nil)
if err != nil {
return err
}
// Look up a delegate token at organization level
_, err = platform.LookupDelegatetoken(ctx, &platform.LookupDelegatetokenArgs{
Name: "org-delegate-token",
AccountId: "account_id",
OrgId: pulumi.StringRef("org_id"),
}, nil)
if err != nil {
return err
}
// Look up a delegate token at project level
_, err = platform.LookupDelegatetoken(ctx, &platform.LookupDelegatetokenArgs{
Name: "project-delegate-token",
AccountId: "account_id",
OrgId: pulumi.StringRef("org_id"),
ProjectId: pulumi.StringRef("project_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;
return await Deployment.RunAsync(() =>
{
// Look up a delegate token at account level by name
var accountLevel = Harness.Platform.GetDelegatetoken.Invoke(new()
{
Name = "account-delegate-token",
AccountId = "account_id",
});
// Look up a delegate token at organization level
var orgLevel = Harness.Platform.GetDelegatetoken.Invoke(new()
{
Name = "org-delegate-token",
AccountId = "account_id",
OrgId = "org_id",
});
// Look up a delegate token at project level
var projectLevel = Harness.Platform.GetDelegatetoken.Invoke(new()
{
Name = "project-delegate-token",
AccountId = "account_id",
OrgId = "org_id",
ProjectId = "project_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.PlatformFunctions;
import com.pulumi.harness.platform.inputs.GetDelegatetokenArgs;
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) {
// Look up a delegate token at account level by name
final var accountLevel = PlatformFunctions.getDelegatetoken(GetDelegatetokenArgs.builder()
.name("account-delegate-token")
.accountId("account_id")
.build());
// Look up a delegate token at organization level
final var orgLevel = PlatformFunctions.getDelegatetoken(GetDelegatetokenArgs.builder()
.name("org-delegate-token")
.accountId("account_id")
.orgId("org_id")
.build());
// Look up a delegate token at project level
final var projectLevel = PlatformFunctions.getDelegatetoken(GetDelegatetokenArgs.builder()
.name("project-delegate-token")
.accountId("account_id")
.orgId("org_id")
.projectId("project_id")
.build());
}
}
variables:
# Look up a delegate token at account level by name
accountLevel:
fn::invoke:
function: harness:platform:getDelegatetoken
arguments:
name: account-delegate-token
accountId: account_id
# Look up a delegate token at organization level
orgLevel:
fn::invoke:
function: harness:platform:getDelegatetoken
arguments:
name: org-delegate-token
accountId: account_id
orgId: org_id
# Look up a delegate token at project level
projectLevel:
fn::invoke:
function: harness:platform:getDelegatetoken
arguments:
name: project-delegate-token
accountId: account_id
orgId: org_id
projectId: project_id
Using getDelegatetoken
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDelegatetoken(args: GetDelegatetokenArgs, opts?: InvokeOptions): Promise<GetDelegatetokenResult>
function getDelegatetokenOutput(args: GetDelegatetokenOutputArgs, opts?: InvokeOptions): Output<GetDelegatetokenResult>
def get_delegatetoken(account_id: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
project_id: Optional[str] = None,
token_status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDelegatetokenResult
def get_delegatetoken_output(account_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
org_id: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
token_status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDelegatetokenResult]
func LookupDelegatetoken(ctx *Context, args *LookupDelegatetokenArgs, opts ...InvokeOption) (*LookupDelegatetokenResult, error)
func LookupDelegatetokenOutput(ctx *Context, args *LookupDelegatetokenOutputArgs, opts ...InvokeOption) LookupDelegatetokenResultOutput
> Note: This function is named LookupDelegatetoken
in the Go SDK.
public static class GetDelegatetoken
{
public static Task<GetDelegatetokenResult> InvokeAsync(GetDelegatetokenArgs args, InvokeOptions? opts = null)
public static Output<GetDelegatetokenResult> Invoke(GetDelegatetokenInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDelegatetokenResult> getDelegatetoken(GetDelegatetokenArgs args, InvokeOptions options)
public static Output<GetDelegatetokenResult> getDelegatetoken(GetDelegatetokenArgs args, InvokeOptions options)
fn::invoke:
function: harness:platform/getDelegatetoken:getDelegatetoken
arguments:
# arguments dictionary
The following arguments are supported:
- Account
Id string - Account Identifier for the Entity
- Name string
- Name of the delegate token
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- Account
Id string - Account Identifier for the Entity
- Name string
- Name of the delegate token
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- account
Id String - Account Identifier for the Entity
- name String
- Name of the delegate token
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- account
Id string - Account Identifier for the Entity
- name string
- Name of the delegate token
- org
Id string - Org Identifier for the Entity
- project
Id string - Project Identifier for the Entity
- token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- account_
id str - Account Identifier for the Entity
- name str
- Name of the delegate token
- org_
id str - Org Identifier for the Entity
- project_
id str - Project Identifier for the Entity
- token_
status str - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- account
Id String - Account Identifier for the Entity
- name String
- Name of the delegate token
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
getDelegatetoken Result
The following output properties are available:
- 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
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the delegate token
- 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.
- Value string
- Value of the delegate token. Encoded in base64.
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- 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
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the delegate token
- 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.
- Value string
- Value of the delegate token. Encoded in base64.
- Org
Id string - Org Identifier for the Entity
- Project
Id string - Project Identifier for the Entity
- Token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- 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
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the delegate token
- 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.
- value String
- Value of the delegate token. Encoded in base64.
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- 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
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Name of the delegate token
- 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.
- value string
- Value of the delegate token. Encoded in base64.
- org
Id string - Org Identifier for the Entity
- project
Id string - Project Identifier for the Entity
- token
Status string - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- 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
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Name of the delegate token
- 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.
- value str
- Value of the delegate token. Encoded in base64.
- org_
id str - Org Identifier for the Entity
- project_
id str - Project Identifier for the Entity
- token_
status str - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
- 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
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the delegate token
- 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.
- value String
- Value of the delegate token. Encoded in base64.
- org
Id String - Org Identifier for the Entity
- project
Id String - Project Identifier for the Entity
- token
Status String - Status of Delegate Token (ACTIVE or REVOKED). If left empty both active and revoked tokens will be assumed
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.