Harness v0.7.2 published on Tuesday, Apr 15, 2025 by Pulumi
harness.platform.getWorkspace
Explore with Pulumi AI
Data source for retrieving workspaces.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
const test = harness.platform.getWorkspace({
    identifier: "identifier",
    orgId: "org_id",
    projectId: "project_id",
});
import pulumi
import pulumi_harness as harness
test = harness.platform.get_workspace(identifier="identifier",
    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.LookupWorkspace(ctx, &platform.LookupWorkspaceArgs{
			Identifier: "identifier",
			OrgId:      "org_id",
			ProjectId:  "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.GetWorkspace.Invoke(new()
    {
        Identifier = "identifier",
        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.GetWorkspaceArgs;
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.getWorkspace(GetWorkspaceArgs.builder()
            .identifier("identifier")
            .orgId("org_id")
            .projectId("project_id")
            .build());
    }
}
variables:
  test:
    fn::invoke:
      function: harness:platform:getWorkspace
      arguments:
        identifier: identifier
        orgId: org_id
        projectId: project_id
Using getWorkspace
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 getWorkspace(args: GetWorkspaceArgs, opts?: InvokeOptions): Promise<GetWorkspaceResult>
function getWorkspaceOutput(args: GetWorkspaceOutputArgs, opts?: InvokeOptions): Output<GetWorkspaceResult>def get_workspace(description: Optional[str] = None,
                  environment_variables: Optional[Sequence[GetWorkspaceEnvironmentVariable]] = None,
                  identifier: Optional[str] = None,
                  org_id: Optional[str] = None,
                  project_id: Optional[str] = None,
                  repository_branch: Optional[str] = None,
                  repository_commit: Optional[str] = None,
                  repository_sha: Optional[str] = None,
                  terraform_variable_files: Optional[Sequence[GetWorkspaceTerraformVariableFile]] = None,
                  terraform_variables: Optional[Sequence[GetWorkspaceTerraformVariable]] = None,
                  variable_sets: Optional[Sequence[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> GetWorkspaceResult
def get_workspace_output(description: Optional[pulumi.Input[str]] = None,
                  environment_variables: Optional[pulumi.Input[Sequence[pulumi.Input[GetWorkspaceEnvironmentVariableArgs]]]] = None,
                  identifier: Optional[pulumi.Input[str]] = None,
                  org_id: Optional[pulumi.Input[str]] = None,
                  project_id: Optional[pulumi.Input[str]] = None,
                  repository_branch: Optional[pulumi.Input[str]] = None,
                  repository_commit: Optional[pulumi.Input[str]] = None,
                  repository_sha: Optional[pulumi.Input[str]] = None,
                  terraform_variable_files: Optional[pulumi.Input[Sequence[pulumi.Input[GetWorkspaceTerraformVariableFileArgs]]]] = None,
                  terraform_variables: Optional[pulumi.Input[Sequence[pulumi.Input[GetWorkspaceTerraformVariableArgs]]]] = None,
                  variable_sets: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetWorkspaceResult]func LookupWorkspace(ctx *Context, args *LookupWorkspaceArgs, opts ...InvokeOption) (*LookupWorkspaceResult, error)
func LookupWorkspaceOutput(ctx *Context, args *LookupWorkspaceOutputArgs, opts ...InvokeOption) LookupWorkspaceResultOutput> Note: This function is named LookupWorkspace in the Go SDK.
public static class GetWorkspace 
{
    public static Task<GetWorkspaceResult> InvokeAsync(GetWorkspaceArgs args, InvokeOptions? opts = null)
    public static Output<GetWorkspaceResult> Invoke(GetWorkspaceInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetWorkspaceResult> getWorkspace(GetWorkspaceArgs args, InvokeOptions options)
public static Output<GetWorkspaceResult> getWorkspace(GetWorkspaceArgs args, InvokeOptions options)
fn::invoke:
  function: harness:platform/getWorkspace:getWorkspace
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Identifier string
- Identifier of the Workspace
- OrgId string
- Organization Identifier
- ProjectId string
- Project Identifier
- Description string
- Description of the Workspace
- EnvironmentVariables List<GetWorkspace Environment Variable> 
- Environment variables configured on the workspace
- RepositoryBranch string
- Repository Branch in which the code should be accessed
- RepositoryCommit string
- Repository Tag in which the code should be accessed
- RepositorySha string
- Repository Commit SHA in which the code should be accessed
- TerraformVariable List<GetFiles Workspace Terraform Variable File> 
- TerraformVariables List<GetWorkspace Terraform Variable> 
- VariableSets List<string>
- Variable sets to use.
- Identifier string
- Identifier of the Workspace
- OrgId string
- Organization Identifier
- ProjectId string
- Project Identifier
- Description string
- Description of the Workspace
- EnvironmentVariables []GetWorkspace Environment Variable 
- Environment variables configured on the workspace
- RepositoryBranch string
- Repository Branch in which the code should be accessed
- RepositoryCommit string
- Repository Tag in which the code should be accessed
- RepositorySha string
- Repository Commit SHA in which the code should be accessed
- TerraformVariable []GetFiles Workspace Terraform Variable File 
- TerraformVariables []GetWorkspace Terraform Variable 
- VariableSets []string
- Variable sets to use.
- identifier String
- Identifier of the Workspace
- orgId String
- Organization Identifier
- projectId String
- Project Identifier
- description String
- Description of the Workspace
- environmentVariables List<GetWorkspace Environment Variable> 
- Environment variables configured on the workspace
- repositoryBranch String
- Repository Branch in which the code should be accessed
- repositoryCommit String
- Repository Tag in which the code should be accessed
- repositorySha String
- Repository Commit SHA in which the code should be accessed
- terraformVariable List<GetFiles Workspace Terraform Variable File> 
- terraformVariables List<GetWorkspace Terraform Variable> 
- variableSets List<String>
- Variable sets to use.
- identifier string
- Identifier of the Workspace
- orgId string
- Organization Identifier
- projectId string
- Project Identifier
- description string
- Description of the Workspace
- environmentVariables GetWorkspace Environment Variable[] 
- Environment variables configured on the workspace
- repositoryBranch string
- Repository Branch in which the code should be accessed
- repositoryCommit string
- Repository Tag in which the code should be accessed
- repositorySha string
- Repository Commit SHA in which the code should be accessed
- terraformVariable GetFiles Workspace Terraform Variable File[] 
- terraformVariables GetWorkspace Terraform Variable[] 
- variableSets string[]
- Variable sets to use.
- identifier str
- Identifier of the Workspace
- org_id str
- Organization Identifier
- project_id str
- Project Identifier
- description str
- Description of the Workspace
- environment_variables Sequence[GetWorkspace Environment Variable] 
- Environment variables configured on the workspace
- repository_branch str
- Repository Branch in which the code should be accessed
- repository_commit str
- Repository Tag in which the code should be accessed
- repository_sha str
- Repository Commit SHA in which the code should be accessed
- terraform_variable_ Sequence[Getfiles Workspace Terraform Variable File] 
- terraform_variables Sequence[GetWorkspace Terraform Variable] 
- variable_sets Sequence[str]
- Variable sets to use.
- identifier String
- Identifier of the Workspace
- orgId String
- Organization Identifier
- projectId String
- Project Identifier
- description String
- Description of the Workspace
- environmentVariables List<Property Map>
- Environment variables configured on the workspace
- repositoryBranch String
- Repository Branch in which the code should be accessed
- repositoryCommit String
- Repository Tag in which the code should be accessed
- repositorySha String
- Repository Commit SHA in which the code should be accessed
- terraformVariable List<Property Map>Files 
- terraformVariables List<Property Map>
- variableSets List<String>
- Variable sets to use.
getWorkspace Result
The following output properties are available:
- CostEstimation boolEnabled 
- If enabled cost estimation operations will be performed in this workspace
- DefaultPipelines Dictionary<string, string>
- Default pipelines associated with this workspace
- Description string
- Description of the Workspace
- EnvironmentVariables List<GetWorkspace Environment Variable> 
- Environment variables configured on the workspace
- Id string
- The provider-assigned unique ID for this managed resource.
- Identifier string
- Identifier of the Workspace
- Name string
- Name of the Workspace
- OrgId string
- Organization Identifier
- ProjectId string
- Project Identifier
- ProviderConnector string
- Provider Connector is the reference to the connector for the infrastructure provider
- ProvisionerType string
- Provisioner type defines the provisioning tool to use.
- ProvisionerVersion string
- Provisioner Version defines the tool version to use
- Repository string
- Repository is the name of the repository to use
- RepositoryBranch string
- Repository Branch in which the code should be accessed
- RepositoryCommit string
- Repository Tag in which the code should be accessed
- RepositoryConnector string
- Repository Connector is the reference to the connector to use for this code
- RepositoryPath string
- Repository Path is the path in which the infra code resides
- RepositorySha string
- Repository Commit SHA in which the code should be accessed
- TerraformVariable List<GetFiles Workspace Terraform Variable File> 
- TerraformVariables List<GetWorkspace Terraform Variable> 
- VariableSets List<string>
- Variable sets to use.
- CostEstimation boolEnabled 
- If enabled cost estimation operations will be performed in this workspace
- DefaultPipelines map[string]string
- Default pipelines associated with this workspace
- Description string
- Description of the Workspace
- EnvironmentVariables []GetWorkspace Environment Variable 
- Environment variables configured on the workspace
- Id string
- The provider-assigned unique ID for this managed resource.
- Identifier string
- Identifier of the Workspace
- Name string
- Name of the Workspace
- OrgId string
- Organization Identifier
- ProjectId string
- Project Identifier
- ProviderConnector string
- Provider Connector is the reference to the connector for the infrastructure provider
- ProvisionerType string
- Provisioner type defines the provisioning tool to use.
- ProvisionerVersion string
- Provisioner Version defines the tool version to use
- Repository string
- Repository is the name of the repository to use
- RepositoryBranch string
- Repository Branch in which the code should be accessed
- RepositoryCommit string
- Repository Tag in which the code should be accessed
- RepositoryConnector string
- Repository Connector is the reference to the connector to use for this code
- RepositoryPath string
- Repository Path is the path in which the infra code resides
- RepositorySha string
- Repository Commit SHA in which the code should be accessed
- TerraformVariable []GetFiles Workspace Terraform Variable File 
- TerraformVariables []GetWorkspace Terraform Variable 
- VariableSets []string
- Variable sets to use.
- costEstimation BooleanEnabled 
- If enabled cost estimation operations will be performed in this workspace
- defaultPipelines Map<String,String>
- Default pipelines associated with this workspace
- description String
- Description of the Workspace
- environmentVariables List<GetWorkspace Environment Variable> 
- Environment variables configured on the workspace
- id String
- The provider-assigned unique ID for this managed resource.
- identifier String
- Identifier of the Workspace
- name String
- Name of the Workspace
- orgId String
- Organization Identifier
- projectId String
- Project Identifier
- providerConnector String
- Provider Connector is the reference to the connector for the infrastructure provider
- provisionerType String
- Provisioner type defines the provisioning tool to use.
- provisionerVersion String
- Provisioner Version defines the tool version to use
- repository String
- Repository is the name of the repository to use
- repositoryBranch String
- Repository Branch in which the code should be accessed
- repositoryCommit String
- Repository Tag in which the code should be accessed
- repositoryConnector String
- Repository Connector is the reference to the connector to use for this code
- repositoryPath String
- Repository Path is the path in which the infra code resides
- repositorySha String
- Repository Commit SHA in which the code should be accessed
- terraformVariable List<GetFiles Workspace Terraform Variable File> 
- terraformVariables List<GetWorkspace Terraform Variable> 
- variableSets List<String>
- Variable sets to use.
- costEstimation booleanEnabled 
- If enabled cost estimation operations will be performed in this workspace
- defaultPipelines {[key: string]: string}
- Default pipelines associated with this workspace
- description string
- Description of the Workspace
- environmentVariables GetWorkspace Environment Variable[] 
- Environment variables configured on the workspace
- id string
- The provider-assigned unique ID for this managed resource.
- identifier string
- Identifier of the Workspace
- name string
- Name of the Workspace
- orgId string
- Organization Identifier
- projectId string
- Project Identifier
- providerConnector string
- Provider Connector is the reference to the connector for the infrastructure provider
- provisionerType string
- Provisioner type defines the provisioning tool to use.
- provisionerVersion string
- Provisioner Version defines the tool version to use
- repository string
- Repository is the name of the repository to use
- repositoryBranch string
- Repository Branch in which the code should be accessed
- repositoryCommit string
- Repository Tag in which the code should be accessed
- repositoryConnector string
- Repository Connector is the reference to the connector to use for this code
- repositoryPath string
- Repository Path is the path in which the infra code resides
- repositorySha string
- Repository Commit SHA in which the code should be accessed
- terraformVariable GetFiles Workspace Terraform Variable File[] 
- terraformVariables GetWorkspace Terraform Variable[] 
- variableSets string[]
- Variable sets to use.
- cost_estimation_ boolenabled 
- If enabled cost estimation operations will be performed in this workspace
- default_pipelines Mapping[str, str]
- Default pipelines associated with this workspace
- description str
- Description of the Workspace
- environment_variables Sequence[GetWorkspace Environment Variable] 
- Environment variables configured on the workspace
- id str
- The provider-assigned unique ID for this managed resource.
- identifier str
- Identifier of the Workspace
- name str
- Name of the Workspace
- org_id str
- Organization Identifier
- project_id str
- Project Identifier
- provider_connector str
- Provider Connector is the reference to the connector for the infrastructure provider
- provisioner_type str
- Provisioner type defines the provisioning tool to use.
- provisioner_version str
- Provisioner Version defines the tool version to use
- repository str
- Repository is the name of the repository to use
- repository_branch str
- Repository Branch in which the code should be accessed
- repository_commit str
- Repository Tag in which the code should be accessed
- repository_connector str
- Repository Connector is the reference to the connector to use for this code
- repository_path str
- Repository Path is the path in which the infra code resides
- repository_sha str
- Repository Commit SHA in which the code should be accessed
- terraform_variable_ Sequence[Getfiles Workspace Terraform Variable File] 
- terraform_variables Sequence[GetWorkspace Terraform Variable] 
- variable_sets Sequence[str]
- Variable sets to use.
- costEstimation BooleanEnabled 
- If enabled cost estimation operations will be performed in this workspace
- defaultPipelines Map<String>
- Default pipelines associated with this workspace
- description String
- Description of the Workspace
- environmentVariables List<Property Map>
- Environment variables configured on the workspace
- id String
- The provider-assigned unique ID for this managed resource.
- identifier String
- Identifier of the Workspace
- name String
- Name of the Workspace
- orgId String
- Organization Identifier
- projectId String
- Project Identifier
- providerConnector String
- Provider Connector is the reference to the connector for the infrastructure provider
- provisionerType String
- Provisioner type defines the provisioning tool to use.
- provisionerVersion String
- Provisioner Version defines the tool version to use
- repository String
- Repository is the name of the repository to use
- repositoryBranch String
- Repository Branch in which the code should be accessed
- repositoryCommit String
- Repository Tag in which the code should be accessed
- repositoryConnector String
- Repository Connector is the reference to the connector to use for this code
- repositoryPath String
- Repository Path is the path in which the infra code resides
- repositorySha String
- Repository Commit SHA in which the code should be accessed
- terraformVariable List<Property Map>Files 
- terraformVariables List<Property Map>
- variableSets List<String>
- Variable sets to use.
Supporting Types
GetWorkspaceEnvironmentVariable   
- key str
- Key is the identifier for the variable`
- value str
- value is the value of the variable
- value_type str
- Value type indicates the value type of the variable, text or secret
GetWorkspaceTerraformVariable   
- key str
- Key is the identifier for the variable`
- value str
- value is the value of the variable
- value_type str
- Value type indicates the value type of the variable, text or secret
GetWorkspaceTerraformVariableFile    
- Repository string
- Repository is the name of the repository to fetch the code from.
- RepositoryBranch string
- Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit or sha is set
- RepositoryCommit string
- Repository commit is tag to fetch the variables from. This cannot be set if repository branch or sha is set.
- RepositoryConnector string
- Repository connector is the reference to the connector used to fetch the variables.
- RepositoryPath string
- Repository path is the path in which the variables reside.
- RepositorySha string
- Repository commit is SHA to fetch the variables from. This cannot be set if repository branch or commit is set.
- Repository string
- Repository is the name of the repository to fetch the code from.
- RepositoryBranch string
- Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit or sha is set
- RepositoryCommit string
- Repository commit is tag to fetch the variables from. This cannot be set if repository branch or sha is set.
- RepositoryConnector string
- Repository connector is the reference to the connector used to fetch the variables.
- RepositoryPath string
- Repository path is the path in which the variables reside.
- RepositorySha string
- Repository commit is SHA to fetch the variables from. This cannot be set if repository branch or commit is set.
- repository String
- Repository is the name of the repository to fetch the code from.
- repositoryBranch String
- Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit or sha is set
- repositoryCommit String
- Repository commit is tag to fetch the variables from. This cannot be set if repository branch or sha is set.
- repositoryConnector String
- Repository connector is the reference to the connector used to fetch the variables.
- repositoryPath String
- Repository path is the path in which the variables reside.
- repositorySha String
- Repository commit is SHA to fetch the variables from. This cannot be set if repository branch or commit is set.
- repository string
- Repository is the name of the repository to fetch the code from.
- repositoryBranch string
- Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit or sha is set
- repositoryCommit string
- Repository commit is tag to fetch the variables from. This cannot be set if repository branch or sha is set.
- repositoryConnector string
- Repository connector is the reference to the connector used to fetch the variables.
- repositoryPath string
- Repository path is the path in which the variables reside.
- repositorySha string
- Repository commit is SHA to fetch the variables from. This cannot be set if repository branch or commit is set.
- repository str
- Repository is the name of the repository to fetch the code from.
- repository_branch str
- Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit or sha is set
- repository_commit str
- Repository commit is tag to fetch the variables from. This cannot be set if repository branch or sha is set.
- repository_connector str
- Repository connector is the reference to the connector used to fetch the variables.
- repository_path str
- Repository path is the path in which the variables reside.
- repository_sha str
- Repository commit is SHA to fetch the variables from. This cannot be set if repository branch or commit is set.
- repository String
- Repository is the name of the repository to fetch the code from.
- repositoryBranch String
- Repository branch is the name of the branch to fetch the variables from. This cannot be set if repository commit or sha is set
- repositoryCommit String
- Repository commit is tag to fetch the variables from. This cannot be set if repository branch or sha is set.
- repositoryConnector String
- Repository connector is the reference to the connector used to fetch the variables.
- repositoryPath String
- Repository path is the path in which the variables reside.
- repositorySha String
- Repository commit is SHA to fetch the variables from. This cannot be set if repository branch or commit is set.
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the harnessTerraform Provider.
