1. Packages
  2. Harness
  3. API Docs
  4. platform
  5. getApiKey
Harness v0.3.2 published on Monday, Sep 16, 2024 by Pulumi

harness.platform.getApiKey

Explore with Pulumi AI

harness logo
Harness v0.3.2 published on Monday, Sep 16, 2024 by Pulumi

    Data source for retrieving a Harness ApiKey.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    const test = harness.platform.getApiKey({
        identifier: "test_apikey",
        name: "test_apikey",
        parentId: "parent_id",
        apikeyType: "USER",
        accountId: "account_id",
        orgId: "org_id",
        projectId: "project_id",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    test = harness.platform.get_api_key(identifier="test_apikey",
        name="test_apikey",
        parent_id="parent_id",
        apikey_type="USER",
        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 {
    		_, err := platform.GetApiKey(ctx, &platform.GetApiKeyArgs{
    			Identifier: "test_apikey",
    			Name:       pulumi.StringRef("test_apikey"),
    			ParentId:   "parent_id",
    			ApikeyType: "USER",
    			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(() => 
    {
        var test = Harness.Platform.GetApiKey.Invoke(new()
        {
            Identifier = "test_apikey",
            Name = "test_apikey",
            ParentId = "parent_id",
            ApikeyType = "USER",
            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.GetApiKeyArgs;
    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) {
            final var test = PlatformFunctions.getApiKey(GetApiKeyArgs.builder()
                .identifier("test_apikey")
                .name("test_apikey")
                .parentId("parent_id")
                .apikeyType("USER")
                .accountId("account_id")
                .orgId("org_id")
                .projectId("project_id")
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          Function: harness:platform:getApiKey
          Arguments:
            identifier: test_apikey
            name: test_apikey
            parentId: parent_id
            apikeyType: USER
            accountId: account_id
            orgId: org_id
            projectId: project_id
    

    Using getApiKey

    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 getApiKey(args: GetApiKeyArgs, opts?: InvokeOptions): Promise<GetApiKeyResult>
    function getApiKeyOutput(args: GetApiKeyOutputArgs, opts?: InvokeOptions): Output<GetApiKeyResult>
    def get_api_key(account_id: Optional[str] = None,
                    apikey_type: Optional[str] = None,
                    default_time_to_expire_token: Optional[int] = None,
                    identifier: Optional[str] = None,
                    name: Optional[str] = None,
                    org_id: Optional[str] = None,
                    parent_id: Optional[str] = None,
                    project_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetApiKeyResult
    def get_api_key_output(account_id: Optional[pulumi.Input[str]] = None,
                    apikey_type: Optional[pulumi.Input[str]] = None,
                    default_time_to_expire_token: Optional[pulumi.Input[int]] = None,
                    identifier: Optional[pulumi.Input[str]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    org_id: Optional[pulumi.Input[str]] = None,
                    parent_id: Optional[pulumi.Input[str]] = None,
                    project_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetApiKeyResult]
    func GetApiKey(ctx *Context, args *GetApiKeyArgs, opts ...InvokeOption) (*GetApiKeyResult, error)
    func GetApiKeyOutput(ctx *Context, args *GetApiKeyOutputArgs, opts ...InvokeOption) GetApiKeyResultOutput

    > Note: This function is named GetApiKey in the Go SDK.

    public static class GetApiKey 
    {
        public static Task<GetApiKeyResult> InvokeAsync(GetApiKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetApiKeyResult> Invoke(GetApiKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetApiKeyResult> getApiKey(GetApiKeyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: harness:platform/getApiKey:getApiKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account Identifier for the Entity
    ApikeyType string
    Type of the API Key
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    DefaultTimeToExpireToken int
    Default expiration time of the Token within API Key
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    AccountId string
    Account Identifier for the Entity
    ApikeyType string
    Type of the API Key
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    DefaultTimeToExpireToken int
    Default expiration time of the Token within API Key
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    accountId String
    Account Identifier for the Entity
    apikeyType String
    Type of the API Key
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    defaultTimeToExpireToken Integer
    Default expiration time of the Token within API Key
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    accountId string
    Account Identifier for the Entity
    apikeyType string
    Type of the API Key
    identifier string
    Unique identifier of the resource.
    parentId string
    Parent Entity Identifier of the API Key
    defaultTimeToExpireToken number
    Default expiration time of the Token within API Key
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    account_id str
    Account Identifier for the Entity
    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
    default_time_to_expire_token int
    Default expiration time of the Token within API Key
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    accountId String
    Account Identifier for the Entity
    apikeyType String
    Type of the API Key
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    defaultTimeToExpireToken Number
    Default expiration time of the Token within API Key
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.

    getApiKey Result

    The following output properties are available:

    AccountId string
    Account Identifier for the Entity
    ApikeyType string
    Type of the API Key
    Description string
    Description of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    Tags List<string>
    Tags to associate with the resource.
    DefaultTimeToExpireToken int
    Default expiration time of the Token within API Key
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    AccountId string
    Account Identifier for the Entity
    ApikeyType string
    Type of the API Key
    Description string
    Description of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource.
    ParentId string
    Parent Entity Identifier of the API Key
    Tags []string
    Tags to associate with the resource.
    DefaultTimeToExpireToken int
    Default expiration time of the Token within API Key
    Name string
    Name of the resource.
    OrgId string
    Unique identifier of the organization.
    ProjectId string
    Unique identifier of the project.
    accountId String
    Account Identifier for the Entity
    apikeyType String
    Type of the API Key
    description String
    Description of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    tags List<String>
    Tags to associate with the resource.
    defaultTimeToExpireToken Integer
    Default expiration time of the Token within API Key
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.
    accountId string
    Account Identifier for the Entity
    apikeyType string
    Type of the API Key
    description string
    Description of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    identifier string
    Unique identifier of the resource.
    parentId string
    Parent Entity Identifier of the API Key
    tags string[]
    Tags to associate with the resource.
    defaultTimeToExpireToken number
    Default expiration time of the Token within API Key
    name string
    Name of the resource.
    orgId string
    Unique identifier of the organization.
    projectId string
    Unique identifier of the project.
    account_id str
    Account Identifier for the Entity
    apikey_type str
    Type of the API Key
    description str
    Description of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    identifier str
    Unique identifier of the resource.
    parent_id str
    Parent Entity Identifier of the API Key
    tags Sequence[str]
    Tags to associate with the resource.
    default_time_to_expire_token int
    Default expiration time of the Token within API Key
    name str
    Name of the resource.
    org_id str
    Unique identifier of the organization.
    project_id str
    Unique identifier of the project.
    accountId String
    Account Identifier for the Entity
    apikeyType String
    Type of the API Key
    description String
    Description of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource.
    parentId String
    Parent Entity Identifier of the API Key
    tags List<String>
    Tags to associate with the resource.
    defaultTimeToExpireToken Number
    Default expiration time of the Token within API Key
    name String
    Name of the resource.
    orgId String
    Unique identifier of the organization.
    projectId String
    Unique identifier of the project.

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Harness v0.3.2 published on Monday, Sep 16, 2024 by Pulumi