1. Packages
  2. Packages
  3. Harness Provider
  4. API Docs
  5. fme
  6. getEnvironment
Viewing docs for Harness v0.12.1
published on Thursday, May 21, 2026 by Pulumi
harness logo
Viewing docs for Harness v0.12.1
published on Thursday, May 21, 2026 by Pulumi

    Look up a Harness FME (Split) environment by name within the workspace for a Harness organization and project. The provider resolves the workspace ID from orgId and projectId on each read.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as harness from "@pulumi/harness";
    
    // Look up a Split environment by name within the FME workspace for a Harness org and project.
    const production = harness.fme.getEnvironment({
        orgId: "organization_id",
        projectId: "project_id",
        name: "Production",
    });
    
    import pulumi
    import pulumi_harness as harness
    
    # Look up a Split environment by name within the FME workspace for a Harness org and project.
    production = harness.fme.get_environment(org_id="organization_id",
        project_id="project_id",
        name="Production")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-harness/sdk/go/harness/fme"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Look up a Split environment by name within the FME workspace for a Harness org and project.
    		_, err := fme.GetEnvironment(ctx, &fme.GetEnvironmentArgs{
    			OrgId:     "organization_id",
    			ProjectId: "project_id",
    			Name:      "Production",
    		}, 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 Split environment by name within the FME workspace for a Harness org and project.
        var production = Harness.Fme.GetEnvironment.Invoke(new()
        {
            OrgId = "organization_id",
            ProjectId = "project_id",
            Name = "Production",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.harness.fme.FmeFunctions;
    import com.pulumi.harness.fme.inputs.GetEnvironmentArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 Split environment by name within the FME workspace for a Harness org and project.
            final var production = FmeFunctions.getEnvironment(GetEnvironmentArgs.builder()
                .orgId("organization_id")
                .projectId("project_id")
                .name("Production")
                .build());
    
        }
    }
    
    variables:
      # Look up a Split environment by name within the FME workspace for a Harness org and project.
      production:
        fn::invoke:
          function: harness:fme:getEnvironment
          arguments:
            orgId: organization_id
            projectId: project_id
            name: Production
    
    Example coming soon!
    

    Using getEnvironment

    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 getEnvironment(args: GetEnvironmentArgs, opts?: InvokeOptions): Promise<GetEnvironmentResult>
    function getEnvironmentOutput(args: GetEnvironmentOutputArgs, opts?: InvokeOptions): Output<GetEnvironmentResult>
    def get_environment(name: Optional[str] = None,
                        org_id: Optional[str] = None,
                        project_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetEnvironmentResult
    def get_environment_output(name: pulumi.Input[Optional[str]] = None,
                        org_id: pulumi.Input[Optional[str]] = None,
                        project_id: pulumi.Input[Optional[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentResult]
    func GetEnvironment(ctx *Context, args *GetEnvironmentArgs, opts ...InvokeOption) (*GetEnvironmentResult, error)
    func GetEnvironmentOutput(ctx *Context, args *GetEnvironmentOutputArgs, opts ...InvokeOption) GetEnvironmentResultOutput

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

    public static class GetEnvironment 
    {
        public static Task<GetEnvironmentResult> InvokeAsync(GetEnvironmentArgs args, InvokeOptions? opts = null)
        public static Output<GetEnvironmentResult> Invoke(GetEnvironmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnvironmentResult> getEnvironment(GetEnvironmentArgs args, InvokeOptions options)
    public static Output<GetEnvironmentResult> getEnvironment(GetEnvironmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: harness:fme/getEnvironment:getEnvironment
      arguments:
        # arguments dictionary
    data "harness_fme_getenvironment" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    Name of the Split environment in the workspace (e.g. Production).
    OrgId string
    Harness organization identifier.
    ProjectId string
    Harness project identifier.
    Name string
    Name of the Split environment in the workspace (e.g. Production).
    OrgId string
    Harness organization identifier.
    ProjectId string
    Harness project identifier.
    name string
    Name of the Split environment in the workspace (e.g. Production).
    org_id string
    Harness organization identifier.
    project_id string
    Harness project identifier.
    name String
    Name of the Split environment in the workspace (e.g. Production).
    orgId String
    Harness organization identifier.
    projectId String
    Harness project identifier.
    name string
    Name of the Split environment in the workspace (e.g. Production).
    orgId string
    Harness organization identifier.
    projectId string
    Harness project identifier.
    name str
    Name of the Split environment in the workspace (e.g. Production).
    org_id str
    Harness organization identifier.
    project_id str
    Harness project identifier.
    name String
    Name of the Split environment in the workspace (e.g. Production).
    orgId String
    Harness organization identifier.
    projectId String
    Harness project identifier.

    getEnvironment Result

    The following output properties are available:

    EnvironmentId string
    The Split environment ID (same as id).
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Name of the Split environment in the workspace (e.g. Production).
    OrgId string
    Harness organization identifier.
    Production bool
    Whether this is a production environment in Split.
    ProjectId string
    Harness project identifier.
    EnvironmentId string
    The Split environment ID (same as id).
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Name of the Split environment in the workspace (e.g. Production).
    OrgId string
    Harness organization identifier.
    Production bool
    Whether this is a production environment in Split.
    ProjectId string
    Harness project identifier.
    environment_id string
    The Split environment ID (same as id).
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Name of the Split environment in the workspace (e.g. Production).
    org_id string
    Harness organization identifier.
    production bool
    Whether this is a production environment in Split.
    project_id string
    Harness project identifier.
    environmentId String
    The Split environment ID (same as id).
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Name of the Split environment in the workspace (e.g. Production).
    orgId String
    Harness organization identifier.
    production Boolean
    Whether this is a production environment in Split.
    projectId String
    Harness project identifier.
    environmentId string
    The Split environment ID (same as id).
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Name of the Split environment in the workspace (e.g. Production).
    orgId string
    Harness organization identifier.
    production boolean
    Whether this is a production environment in Split.
    projectId string
    Harness project identifier.
    environment_id str
    The Split environment ID (same as id).
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Name of the Split environment in the workspace (e.g. Production).
    org_id str
    Harness organization identifier.
    production bool
    Whether this is a production environment in Split.
    project_id str
    Harness project identifier.
    environmentId String
    The Split environment ID (same as id).
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Name of the Split environment in the workspace (e.g. Production).
    orgId String
    Harness organization identifier.
    production Boolean
    Whether this is a production environment in Split.
    projectId String
    Harness project identifier.

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Viewing docs for Harness v0.12.1
    published on Thursday, May 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial